diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-02 17:05:42 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-06-02 17:05:42 +0300 |
commit | b93c9c23c9b51d4a1bfd26a5b400186315e89976 (patch) | |
tree | 093f23b182af1176526148dae1fb5abc5e008194 /library/cpp/monlib/encode/buffered/string_pool.h | |
parent | c768b09694655b942cfd5bc66db6c8c2ece24f75 (diff) | |
download | ydb-b93c9c23c9b51d4a1bfd26a5b400186315e89976.tar.gz |
intermediate changes
ref:8868513666cce733c1c659c7f2d683ffab1150dd
Diffstat (limited to 'library/cpp/monlib/encode/buffered/string_pool.h')
-rw-r--r-- | library/cpp/monlib/encode/buffered/string_pool.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/library/cpp/monlib/encode/buffered/string_pool.h b/library/cpp/monlib/encode/buffered/string_pool.h index 7630cee353..b7ab01d2a1 100644 --- a/library/cpp/monlib/encode/buffered/string_pool.h +++ b/library/cpp/monlib/encode/buffered/string_pool.h @@ -33,7 +33,10 @@ namespace NMonitoring { TStringPoolBuilder& Build(); TStringBuf Get(ui32 index) const { - Y_ENSURE(IsBuilt_, "Pool must be sorted first"); + if (RequiresSorting_) { + Y_ENSURE(IsBuilt_, "Pool must be sorted first"); + } + return StrVector_.at(index).first; } @@ -43,7 +46,8 @@ namespace NMonitoring { template <typename TConsumer> void ForEach(TConsumer&& c) { - Y_ENSURE(IsBuilt_, "Pool must be sorted first"); + Y_ENSURE(IsBuilt_, "Pool must be built first"); + for (const auto& value : StrVector_) { c(value.first, value.second->Index, value.second->Frequency); } |