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

Method Equal

common/values/string_value.cc:118–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118absl::Status StringValue::Equal(
119 const Value& other,
120 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
121 google::protobuf::MessageFactory* absl_nonnull message_factory,
122 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
123 ABSL_DCHECK(descriptor_pool != nullptr);
124 ABSL_DCHECK(message_factory != nullptr);
125 ABSL_DCHECK(arena != nullptr);
126 ABSL_DCHECK(result != nullptr);
127
128 if (auto other_value = other.AsString(); other_value.has_value()) {
129 *result = NativeValue([other_value](const auto& value) -> BoolValue {
130 return other_value->NativeValue(
131 [&value](const auto& other_value) -> BoolValue {
132 return BoolValue{value == other_value};
133 });
134 });
135 return absl::OkStatus();
136 }
137 *result = FalseValue();
138 return absl::OkStatus();
139}
140
141size_t StringValue::Size() const {
142 return NativeValue([](const auto& alternative) -> size_t {

Callers

nothing calls this directly

Calls 5

FalseValueFunction · 0.85
NativeValueFunction · 0.70
AsStringMethod · 0.45
has_valueMethod · 0.45
NativeValueMethod · 0.45

Tested by

no test coverage detected