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 | |
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')
-rw-r--r-- | library/cpp/archive/models_archive_reader.cpp | 15 | ||||
-rw-r--r-- | library/cpp/archive/models_archive_reader.h | 12 | ||||
-rw-r--r-- | library/cpp/archive/ya.make | 1 | ||||
-rw-r--r-- | library/cpp/lwtrace/mon/mon_lwtrace.cpp | 2 | ||||
-rw-r--r-- | library/cpp/monlib/service/pages/templates.h | 10 | ||||
-rw-r--r-- | library/cpp/resource/registry.cpp | 6 | ||||
-rw-r--r-- | library/cpp/resource/registry.h | 4 | ||||
-rw-r--r-- | library/cpp/tld/tlds-alpha-by-domain.txt | 2 |
8 files changed, 26 insertions, 26 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; +} diff --git a/library/cpp/archive/models_archive_reader.h b/library/cpp/archive/models_archive_reader.h index a5731b01cb..12347bf55e 100644 --- a/library/cpp/archive/models_archive_reader.h +++ b/library/cpp/archive/models_archive_reader.h @@ -2,7 +2,6 @@ #include <util/generic/fwd.h> #include <util/generic/ptr.h> -#include <util/generic/hash_set.h> class IInputStream; @@ -18,14 +17,5 @@ public: virtual TBlob ObjectBlobByKey(const TStringBuf key) const = 0; virtual TBlob BlobByKey(const TStringBuf key) const = 0; virtual bool Compressed() const = 0; - virtual THashSet<TStringBuf> FilterByPrefix(TStringBuf prefix, TStringBuf suffix) const { - THashSet<TStringBuf> result; - for (size_t ind = 0; ind < Count(); ++ind) { - TStringBuf path = KeyByIndex(ind); - if (path.StartsWith(prefix) && path.EndsWith(suffix)) { - result.insert(path); - } - } - return result; - } + virtual THashSet<TStringBuf> FilterByPrefix(TStringBuf prefix, TStringBuf suffix) const; }; diff --git a/library/cpp/archive/ya.make b/library/cpp/archive/ya.make index ff20c9ffbd..613c370dba 100644 --- a/library/cpp/archive/ya.make +++ b/library/cpp/archive/ya.make @@ -5,6 +5,7 @@ SRCS( yarchive.h directory_models_archive_reader.cpp directory_models_archive_reader.h + models_archive_reader.cpp ) END() diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.cpp b/library/cpp/lwtrace/mon/mon_lwtrace.cpp index 6642b07098..09d56560c4 100644 --- a/library/cpp/lwtrace/mon/mon_lwtrace.cpp +++ b/library/cpp/lwtrace/mon/mon_lwtrace.cpp @@ -3451,8 +3451,8 @@ public: HTML(os) { TABLE() { TTimeline timeline = MakeTimeline(node); + TABLED() {}; TABLEHEAD() TABLER() { - TABLED(); for (auto& e : timeline) TABLED() { TPatternNode* subnode = e.first; os << subnode->Name; diff --git a/library/cpp/monlib/service/pages/templates.h b/library/cpp/monlib/service/pages/templates.h index ab1d91c54e..6cdcd6525c 100644 --- a/library/cpp/monlib/service/pages/templates.h +++ b/library/cpp/monlib/service/pages/templates.h @@ -3,15 +3,7 @@ #include <util/stream/output.h> #include <util/system/defaults.h> -#define WITH_SCOPED(var, value) WITH_SCOPED_I(var, value, Y_GENERATE_UNIQUE_ID(WITH_SCOPED_LABEL_)) - -#define WITH_SCOPED_I(var, value, label) \ - if (auto var = (value)) { \ - Y_UNUSED(var); \ - goto label; \ - } else \ - label \ - : +#define WITH_SCOPED(var, value) if (auto var = (value); Y_UNUSED(var), true) #define TAG(name) WITH_SCOPED(tmp, ::NMonitoring::name(__stream)) #define TAG_CLASS(name, cls) WITH_SCOPED(tmp, ::NMonitoring::name(__stream, cls)) diff --git a/library/cpp/resource/registry.cpp b/library/cpp/resource/registry.cpp index c5d6543c65..e403ba8ede 100644 --- a/library/cpp/resource/registry.cpp +++ b/library/cpp/resource/registry.cpp @@ -20,7 +20,7 @@ namespace { typedef std::pair<TStringBuf, TStringBuf> TDescriptor; - struct TStore: public IStore, public THashMap<TStringBuf, TDescriptor*> { + struct TStore final: public IStore, public THashMap<TStringBuf, TDescriptor*> { void Store(const TStringBuf key, const TStringBuf data) override { if (contains(key)) { const TStringBuf value = (*this)[key]->second; @@ -115,3 +115,7 @@ TString NResource::Decompress(const TStringBuf data) { IStore* NResource::CommonStore() { return SingletonWithPriority<TStore, 0>(); } + +NResource::TRegHelper::TRegHelper(const TStringBuf key, const TStringBuf data) { + CommonStore()->Store(key, data); +} diff --git a/library/cpp/resource/registry.h b/library/cpp/resource/registry.h index 698ca5354d..d7f687cff8 100644 --- a/library/cpp/resource/registry.h +++ b/library/cpp/resource/registry.h @@ -29,8 +29,6 @@ namespace NResource { IStore* CommonStore(); struct TRegHelper { - inline TRegHelper(const TStringBuf key, const TStringBuf data) { - CommonStore()->Store(key, data); - } + TRegHelper(const TStringBuf key, const TStringBuf data); }; } diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt index 74a898128a..63a2471c7e 100644 --- a/library/cpp/tld/tlds-alpha-by-domain.txt +++ b/library/cpp/tld/tlds-alpha-by-domain.txt @@ -1,4 +1,4 @@ -# Version 2024020701, Last Updated Wed Feb 7 07:07:01 2024 UTC +# Version 2024021300, Last Updated Tue Feb 13 07:07:01 2024 UTC AAA AARP ABB |