MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / Key

Function Key

native/thirdpart/flatbuffers/flexbuffers.h:1007–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005 }
1006
1007 size_t Key(const char *str, size_t len) {
1008 auto sloc = buf_.size();
1009 WriteBytes(str, len + 1);
1010 if (flags_ & BUILDER_FLAG_SHARE_KEYS) {
1011 auto it = key_pool.find(sloc);
1012 if (it != key_pool.end()) {
1013 // Already in the buffer. Remove key we just serialized, and use
1014 // existing offset instead.
1015 buf_.resize(sloc);
1016 sloc = *it;
1017 } else {
1018 key_pool.insert(sloc);
1019 }
1020 }
1021 stack_.push_back(Value(static_cast<uint64_t>(sloc), FBT_KEY, BIT_WIDTH_8));
1022 return sloc;
1023 }
1024
1025 size_t Key(const char *str) { return Key(str, strlen(str)); }
1026 size_t Key(const std::string &str) { return Key(str.c_str(), str.size()); }

Callers 15

NullFunction · 0.85
IntFunction · 0.85
UIntFunction · 0.85
FloatFunction · 0.85
DoubleFunction · 0.85
BoolFunction · 0.85
IndirectIntFunction · 0.85
IndirectUIntFunction · 0.85
IndirectFloatFunction · 0.85
IndirectDoubleFunction · 0.85
StringFunction · 0.85
StartVectorFunction · 0.85

Calls 6

WriteBytesFunction · 0.85
push_backMethod · 0.80
ValueClass · 0.70
sizeMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected