diff options
author | my34 <my34@yandex-team.ru> | 2022-02-10 16:47:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:05 +0300 |
commit | 3f4e5b0a63eff1c9296c05552fabdd5e3d9371f7 (patch) | |
tree | 582a730fd7c91aa8e3f49b8eaa3ae6e212402a0b /library/cpp/containers/comptrie/loader/loader.h | |
parent | c74559fb88da8adac0d9186cfa55a6b13c47695f (diff) | |
download | ydb-3f4e5b0a63eff1c9296c05552fabdd5e3d9371f7.tar.gz |
Restoring authorship annotation for <my34@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/comptrie/loader/loader.h')
-rw-r--r-- | library/cpp/containers/comptrie/loader/loader.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/containers/comptrie/loader/loader.h b/library/cpp/containers/comptrie/loader/loader.h index ee10e9b451..ef3ba69115 100644 --- a/library/cpp/containers/comptrie/loader/loader.h +++ b/library/cpp/containers/comptrie/loader/loader.h @@ -1,22 +1,22 @@ -#pragma once - +#pragma once + #include <library/cpp/archive/yarchive.h> #include <util/generic/string.h> -#include <util/generic/ptr.h> -#include <util/generic/yexception.h> -#include <util/memory/blob.h> - -template <class TrieType, size_t N> +#include <util/generic/ptr.h> +#include <util/generic/yexception.h> +#include <util/memory/blob.h> + +template <class TrieType, size_t N> TrieType LoadTrieFromArchive(const TString& key, - const unsigned char (&data)[N], + const unsigned char (&data)[N], bool ignoreErrors = false) { - TArchiveReader archive(TBlob::NoCopy(data, sizeof(data))); - if (archive.Has(key)) { + TArchiveReader archive(TBlob::NoCopy(data, sizeof(data))); + if (archive.Has(key)) { TAutoPtr<IInputStream> trie = archive.ObjectByKey(key); - return TrieType(TBlob::FromStream(*trie)); - } - if (!ignoreErrors) { - ythrow yexception() << "Resource " << key << " not found"; - } - return TrieType(); -} + return TrieType(TBlob::FromStream(*trie)); + } + if (!ignoreErrors) { + ythrow yexception() << "Resource " << key << " not found"; + } + return TrieType(); +} |