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

Method sortedMapKeys

valdi_core/src/valdi_core/cpp/Utils/Value.cpp:485–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485std::vector<StringBox> Value::sortedMapKeys() const {
486 std::vector<StringBox> keys;
487
488 const auto* map = getMap();
489 if (map != nullptr) {
490 keys.reserve(map->size());
491
492 for (const auto& it : *map) {
493 keys.emplace_back(it.first);
494 }
495
496 std::sort(keys.begin(), keys.end(), [](const StringBox& left, const StringBox& right) -> bool {
497 return left.toStringView() < right.toStringView();
498 });
499 }
500
501 return keys;
502}
503
504bool Value::toBool() const noexcept {
505 switch (getType()) {

Callers 2

serializeValueFunction · 0.80
serializeMetadataMethod · 0.80

Calls 5

endMethod · 0.65
reserveMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
toStringViewMethod · 0.45

Tested by

no test coverage detected