summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-04-23 12:23:05 +0200
committerTor Egge <Tor.Egge@broadpark.no>2020-04-23 12:23:05 +0200
commitc1580e721443ce5ba22a044714e623399524f8d0 (patch)
treecf8d2fcc540bfc5658505deea14d1195e656ab50 /eval
parentb7d47818f71d03727c628ee3fed02b69e30439b5 (diff)
Unwrap reference wrappers to avoid extra indirections via
invalid memory.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/eval/make_tensor_function.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/eval/src/vespa/eval/eval/make_tensor_function.cpp b/eval/src/vespa/eval/eval/make_tensor_function.cpp
index f503532c1f9..3a73a3b8784 100644
--- a/eval/src/vespa/eval/eval/make_tensor_function.cpp
+++ b/eval/src/vespa/eval/eval/make_tensor_function.cpp
@@ -59,37 +59,37 @@ struct TensorFunctionBuilder : public NodeVisitor, public NodeTraverser {
void make_reduce(const Node &, Aggr aggr, const std::vector<vespalib::string> &dimensions) {
assert(stack.size() >= 1);
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::reduce(a, aggr, dimensions, stash);
}
void make_map(const Node &, map_fun_t function) {
assert(stack.size() >= 1);
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::map(a, function, stash);
}
void make_join(const Node &, join_fun_t function) {
assert(stack.size() >= 2);
- const auto &b = stack.back();
+ const auto &b = stack.back().get();
stack.pop_back();
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::join(a, b, function, stash);
}
void make_merge(const Node &, join_fun_t function) {
assert(stack.size() >= 2);
- const auto &b = stack.back();
+ const auto &b = stack.back().get();
stack.pop_back();
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::merge(a, b, function, stash);
}
void make_concat(const Node &, const vespalib::string &dimension) {
assert(stack.size() >= 2);
- const auto &b = stack.back();
+ const auto &b = stack.back().get();
stack.pop_back();
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::concat(a, b, dimension, stash);
}
@@ -156,17 +156,17 @@ struct TensorFunctionBuilder : public NodeVisitor, public NodeTraverser {
void make_rename(const Node &, const std::vector<vespalib::string> &from, const std::vector<vespalib::string> &to) {
assert(stack.size() >= 1);
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::rename(a, from, to, stash);
}
void make_if(const Node &) {
assert(stack.size() >= 3);
- const auto &c = stack.back();
+ const auto &c = stack.back().get();
stack.pop_back();
- const auto &b = stack.back();
+ const auto &b = stack.back().get();
stack.pop_back();
- const auto &a = stack.back();
+ const auto &a = stack.back().get();
stack.back() = tensor_function::if_node(a, b, c, stash);
}