MCPcopy Create free account
hub / github.com/bytedance/bolt / analyzeValue

Method analyzeValue

bolt/exec/VectorHasher.cpp:588–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586
587template <>
588void VectorHasher::analyzeValue(StringView value) {
589 int size = value.size();
590 auto data = value.data();
591 if (!rangeOverflow_) {
592 if (size > kStringASRangeMaxSize) {
593 setRangeOverflow();
594 } else {
595 int64_t number = stringAsNumber(data, size);
596 updateRange(number);
597 }
598 }
599 if (!distinctOverflow_) {
600 UniqueValue unique(data, size);
601 unique.setId(uniqueValues_.size() + 1);
602 auto pair = uniqueValues_.insert(unique);
603 if (pair.second) {
604 if (uniqueValues_.size() > kMaxDistinct) {
605 setDistinctOverflow();
606 return;
607 }
608 copyStringToLocal(&*pair.first);
609 }
610 }
611}
612
613void VectorHasher::copyStringToLocal(const UniqueValue* unique) {
614 auto size = unique->size();

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
dataMethod · 0.45
setIdMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected