MCPcopy Create free account
hub / github.com/Snapchat/Valdi / preprocessValue

Method preprocessValue

valdi/src/valdi/runtime/Attributes/AttributeValue.cpp:53–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53Result<Value> AttributeValue::preprocessValue(const AttributeHandler* handler) {
54 if (preprocessedValue.empty()) {
55 // Value has not been preprocessed yet, do it now.
56 preprocessedValue = handler->preprocess(value);
57 }
58
59 if (!preprocessedValue) {
60 return preprocessedValue.error();
61 }
62
63 return preprocessedValue.value().value;
64}
65
66Value AttributeValue::dump(AttributeId attributeId) const {
67 static auto kValueKey = STRING_LITERAL("value");

Callers 1

Calls 4

errorMethod · 0.65
valueMethod · 0.65
emptyMethod · 0.45
preprocessMethod · 0.45

Tested by

no test coverage detected