MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Clear

Method Clear

eval/eval/evaluator_stack.h:98–113  ·  view source on GitHub ↗

Dumps the entire stack state as is.

Source from the content-addressed store, hash-verified

96
97 // Dumps the entire stack state as is.
98 void Clear() {
99 if (max_size() > 0) {
100 const size_t n = size();
101 std::destroy_n(values_begin_, n);
102 std::destroy_n(attributes_begin_, n);
103
104 ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(
105 values_begin_, values_begin_ + max_size_, values_, values_begin_);
106 ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(attributes_begin_,
107 attributes_begin_ + max_size_,
108 attributes_, attributes_begin_);
109
110 values_ = values_begin_;
111 attributes_ = attributes_begin_;
112 }
113 }
114
115 // Gets the last size elements of the stack.
116 // Checking that stack has enough elements is caller's responsibility.

Callers

nothing calls this directly

Calls 2

max_sizeFunction · 0.50
sizeFunction · 0.50

Tested by

no test coverage detected