diff options
author | AlexSm <alex@ydb.tech> | 2024-02-16 11:51:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-16 11:51:30 +0100 |
commit | 506ecaee93b52cc12c2e2f97c3d42e3ca2a7f59e (patch) | |
tree | d096fb9eb988fbb0ca1ba970041773207ce3aa70 /library/cpp/archive/models_archive_reader.cpp | |
parent | 4749b9e5d260714490997e6f5ee1ee8c1c8fc46c (diff) | |
parent | f200f72c9d7a89c1018e3dc6b46c49fe2ecf84fb (diff) | |
download | ydb-506ecaee93b52cc12c2e2f97c3d42e3ca2a7f59e.tar.gz |
Merge pull request #1940 from dcherednik/importlib
Library import 14
Diffstat (limited to 'library/cpp/archive/models_archive_reader.cpp')
-rw-r--r-- | library/cpp/archive/models_archive_reader.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/library/cpp/archive/models_archive_reader.cpp b/library/cpp/archive/models_archive_reader.cpp new file mode 100644 index 0000000000..abbb91d628 --- /dev/null +++ b/library/cpp/archive/models_archive_reader.cpp @@ -0,0 +1,15 @@ +#include "models_archive_reader.h" + +#include <util/generic/hash_set.h> + +THashSet<TStringBuf> IModelsArchiveReader::FilterByPrefix(TStringBuf prefix, TStringBuf suffix) const { + THashSet<TStringBuf> result; + const size_t count = Count(); + for (size_t ind = 0; ind < count; ++ind) { + TString path = KeyByIndex(ind); + if (path.StartsWith(prefix) && path.EndsWith(suffix)) { + result.insert(std::move(path)); + } + } + return result; +} |