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

Method FindByValue

native/thirdpart/flatbuffers/idl_parser.cpp:2132–2145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2130}
2131
2132EnumVal *EnumDef::FindByValue(const std::string &constant) const {
2133 int64_t i64;
2134 auto done = false;
2135 if (IsUInt64()) {
2136 uint64_t u64; // avoid reinterpret_cast of pointers
2137 done = StringToNumber(constant.c_str(), &u64);
2138 i64 = static_cast<int64_t>(u64);
2139 } else {
2140 done = StringToNumber(constant.c_str(), &i64);
2141 }
2142 FLATBUFFERS_ASSERT(done);
2143 if (!done) return nullptr;
2144 return ReverseLookup(i64, false);
2145}
2146
2147void EnumDef::SortByValue() {
2148 auto &v = vals.vec;

Callers 1

ParseFieldMethod · 0.80

Calls 2

StringToNumberFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected