MCPcopy Create free account
hub / github.com/catboost/catboost / SelectStrings

Function SelectStrings

tools/enum_parser/parse_enum/benchmark/main.cpp:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19 template <class TEnum>
20 TVector<TStringBuf> SelectStrings(size_t count) {
21 TVector<TStringBuf> strings(Reserve(GetEnumItemsCount<TEnum>()));
22 for (const auto& [_, s] : GetEnumNames<TEnum>()) {
23 strings.push_back(s);
24 }
25 SortBy(strings, [](const TStringBuf& s) { return THash<TStringBuf>()(s); });
26 strings.crop(count);
27 return strings;
28 }
29
30 template <class TEnum, class TContext>
31 void BMToString(TContext& iface) {

Callers

nothing calls this directly

Calls 4

ReserveFunction · 0.85
SortByFunction · 0.85
cropMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected