MCPcopy Create free account
hub / github.com/apache/arrow / GetOrInsert

Method GetOrInsert

cpp/src/arrow/dataset/subtree_internal.h:81–89  ·  view source on GitHub ↗

Encode a subexpression (returning the existing code if possible).

Source from the content-addressed store, hash-verified

79
80 // Encode a subexpression (returning the existing code if possible).
81 expression_code GetOrInsert(const compute::Expression& expr) {
82 auto next_code = static_cast<int>(expr_to_code_.size());
83 auto it_success = expr_to_code_.emplace(expr, next_code);
84
85 if (it_success.second) {
86 code_to_expr_.push_back(expr);
87 }
88 return it_success.first->second;
89 }
90
91 // Encode an expression (recursively breaking up conjunction members if possible).
92 void EncodeConjunctionMembers(const compute::Expression& expr,

Callers 1

TESTFunction · 0.45

Calls 2

push_backMethod · 0.80
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36