diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/codecs | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/codecs')
19 files changed, 112 insertions, 112 deletions
diff --git a/library/cpp/codecs/codecs_registry.cpp b/library/cpp/codecs/codecs_registry.cpp index 17d07062ab..c3a5a9839f 100644 --- a/library/cpp/codecs/codecs_registry.cpp +++ b/library/cpp/codecs/codecs_registry.cpp @@ -16,13 +16,13 @@ namespace NCodecs { return Singleton<NPrivate::TCodecRegistry>()->GetCodec(name); } - TVector<TString> ICodec::GetCodecsList() { + TVector<TString> ICodec::GetCodecsList() { return Singleton<NPrivate::TCodecRegistry>()->GetCodecsList(); } namespace NPrivate { void TCodecRegistry::RegisterFactory(TFactoryPtr fac) { - TVector<TString> names = fac->ListNames(); + TVector<TString> names = fac->ListNames(); for (const auto& name : names) { Y_VERIFY(!Registry.contains(name), "already has %s", name.data()); Registry[name] = fac; @@ -51,9 +51,9 @@ namespace NCodecs { } } - TVector<TString> TCodecRegistry::GetCodecsList() const { + TVector<TString> TCodecRegistry::GetCodecsList() const { using namespace NPrivate; - TVector<TString> vs; + TVector<TString> vs; vs.push_back("none"); for (const auto& it : Registry) { @@ -99,8 +99,8 @@ namespace NCodecs { ythrow TNoCodecException(name); } - TVector<TString> ListNames() const override { - TVector<TString> vs; + TVector<TString> ListNames() const override { + TVector<TString> vs; vs.push_back(ToString(TSolarCodec::MyName())); vs.push_back(ToString(TSolarCodec::MyName8k())); vs.push_back(ToString(TSolarCodec::MyName16k())); @@ -122,7 +122,7 @@ namespace NCodecs { return new TZStdDictCodec(TZStdDictCodec::ParseCompressionName(name)); } - TVector<TString> ListNames() const override { + TVector<TString> ListNames() const override { return TZStdDictCodec::ListCompressionNames(); } }; @@ -139,8 +139,8 @@ namespace NCodecs { } } - TVector<TString> ListNames() const override { - TVector<TString> vs; + TVector<TString> ListNames() const override { + TVector<TString> vs; vs.push_back(ToString(TCompTableCodec::MyNameHQ())); vs.push_back(ToString(TCompTableCodec::MyNameLQ())); return vs; @@ -155,7 +155,7 @@ namespace NCodecs { { } - TString GetName() const override { + TString GetName() const override { return ToString(Codec->Name()); } @@ -175,7 +175,7 @@ namespace NCodecs { }; struct TBlockCodecsFactory : ICodecFactory { - using TRegistry = THashMap<TString, TCodecPtr>; + using TRegistry = THashMap<TString, TCodecPtr>; TRegistry Registry; TBlockCodecsFactory() { @@ -196,8 +196,8 @@ namespace NCodecs { return Registry.find(name)->second; } - TVector<TString> ListNames() const override { - TVector<TString> res; + TVector<TString> ListNames() const override { + TVector<TString> res; for (const auto& it : Registry) { res.push_back(it.first); } diff --git a/library/cpp/codecs/codecs_registry.h b/library/cpp/codecs/codecs_registry.h index 53710310d5..1c82365d8f 100644 --- a/library/cpp/codecs/codecs_registry.h +++ b/library/cpp/codecs/codecs_registry.h @@ -13,7 +13,7 @@ namespace NCodecs { struct ICodecFactory : TAtomicRefCount<ICodecFactory> { virtual ~ICodecFactory() = default; virtual TCodecPtr MakeCodec(TStringBuf name) const = 0; - virtual TVector<TString> ListNames() const = 0; + virtual TVector<TString> ListNames() const = 0; }; typedef TIntrusivePtr<ICodecFactory> TCodecFactoryPtr; @@ -25,15 +25,15 @@ namespace NCodecs { return new TCodec; } - TVector<TString> ListNames() const override { - TVector<TString> vs; + TVector<TString> ListNames() const override { + TVector<TString> vs; vs.push_back(ToString(TCodec::MyName())); return vs; } }; class TCodecRegistry { - using TRegistry = THashMap<TString, TIntrusivePtr<ICodecFactory>>; + using TRegistry = THashMap<TString, TIntrusivePtr<ICodecFactory>>; TRegistry Registry; public: @@ -45,7 +45,7 @@ namespace NCodecs { TCodecPtr GetCodec(TStringBuf name) const; - TVector<TString> GetCodecsList() const; + TVector<TString> GetCodecsList() const; }; } diff --git a/library/cpp/codecs/comptable_codec.cpp b/library/cpp/codecs/comptable_codec.cpp index 476b8ada80..a9ffacf35e 100644 --- a/library/cpp/codecs/comptable_codec.cpp +++ b/library/cpp/codecs/comptable_codec.cpp @@ -22,7 +22,7 @@ namespace NCodecs { return 0; } - TVector<char> result; + TVector<char> result; Compressor->Compress(in, &result); out.Assign(&result[0], result.size()); return 0; @@ -34,7 +34,7 @@ namespace NCodecs { return; } - TVector<char> result; + TVector<char> result; Decompressor->Decompress(in, &result); out.Assign(&result[0], result.size()); } @@ -81,7 +81,7 @@ namespace NCodecs { TCompTableCodec::~TCompTableCodec() = default; - TString TCompTableCodec::GetName() const { + TString TCompTableCodec::GetName() const { return ToString(Impl->Quality ? MyNameHQ() : MyNameLQ()); } diff --git a/library/cpp/codecs/greedy_dict/ut/greedy_dict_ut.cpp b/library/cpp/codecs/greedy_dict/ut/greedy_dict_ut.cpp index 679089a11b..7adf8d4967 100644 --- a/library/cpp/codecs/greedy_dict/ut/greedy_dict_ut.cpp +++ b/library/cpp/codecs/greedy_dict/ut/greedy_dict_ut.cpp @@ -125,7 +125,7 @@ class TGreedyDictTest: public TTestBase { data.insert(data.begin(), urls, urls + Y_ARRAY_SIZE(urls)); } - typedef THashMap<TStringBuf, NGreedyDict::TEntry> TDict; + typedef THashMap<TStringBuf, NGreedyDict::TEntry> TDict; TAutoPtr<NGreedyDict::TEntrySet> DoTestBuilder(const NGreedyDict::TBuildSettings& s, TDict& res) { @@ -159,7 +159,7 @@ class TGreedyDictTest: public TTestBase { void TestBuilder() { TAutoPtr<NGreedyDict::TEntrySet> set; - THashMap<TStringBuf, NGreedyDict::TEntry> res; + THashMap<TStringBuf, NGreedyDict::TEntry> res; NGreedyDict::TBuildSettings s; set = DoTestBuilder(s, res); diff --git a/library/cpp/codecs/huffman_codec.cpp b/library/cpp/codecs/huffman_codec.cpp index 650fe7cdfd..ff618fd955 100644 --- a/library/cpp/codecs/huffman_codec.cpp +++ b/library/cpp/codecs/huffman_codec.cpp @@ -496,10 +496,10 @@ namespace NCodecs { : Original(codec) { CacheEntries.resize(1 << CACHE_BITS_COUNT); - DecodeCache.reserve(CacheEntries.size() * 2); + DecodeCache.reserve(CacheEntries.size() * 2); char buffer[2]; TBuffer decoded; - for (size_t i = 0; i < CacheEntries.size(); i++) { + for (size_t i = 0; i < CacheEntries.size(); i++) { buffer[1] = i >> 8; buffer[0] = i; NBitIO::TBitInput bin(buffer, buffer + sizeof(buffer)); diff --git a/library/cpp/codecs/sample.h b/library/cpp/codecs/sample.h index 15f03afcc5..8aa62c7abd 100644 --- a/library/cpp/codecs/sample.h +++ b/library/cpp/codecs/sample.h @@ -30,11 +30,11 @@ namespace NCodecs { template <class TItem> class TSimpleSequenceReader: public ISequenceReader { - const TVector<TItem>& Items; + const TVector<TItem>& Items; size_t Idx = 0; public: - TSimpleSequenceReader(const TVector<TItem>& items) + TSimpleSequenceReader(const TVector<TItem>& items) : Items(items) { } @@ -64,13 +64,13 @@ namespace NCodecs { } template <class TIter, class TGetter> - TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes, TGetter getter) { + TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes, TGetter getter) { TFastRng64 rng{0x1ce1f2e507541a05, 0x07d45659, 0x7b8771030dd9917e, 0x2d6636ce}; size_t totalBytes = GetInputSize(begin, end, getter); double sampleProb = (double)sampleSizeBytes / Max<size_t>(1, totalBytes); - TVector<TBuffer> result; + TVector<TBuffer> result; for (TIter iter = begin; iter != end; ++iter) { if (sampleProb >= 1 || rng.GenRandReal1() < sampleProb) { TStringBuf reg = getter(iter); @@ -82,7 +82,7 @@ namespace NCodecs { } template <class TIter> - TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes) { + TVector<TBuffer> GetSample(TIter begin, TIter end, size_t sampleSizeBytes) { return GetSample(begin, end, sampleSizeBytes, IterToStringBuf<TIter>); } diff --git a/library/cpp/codecs/static/builder.cpp b/library/cpp/codecs/static/builder.cpp index 93e34a3edb..3df19eeedf 100644 --- a/library/cpp/codecs/static/builder.cpp +++ b/library/cpp/codecs/static/builder.cpp @@ -9,7 +9,7 @@ #include <util/string/subst.h> namespace NCodecs { - TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo& info) { + TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo& info) { TStaticCodecInfo result; TCodecPtr codec = ICodec::GetInstance(info.CodecName); Y_ENSURE_EX(codec, TCodecException() << "empty codec is not allowed"); @@ -31,8 +31,8 @@ namespace NCodecs { return result; } - TString GetStandardFileName(const TStaticCodecInfo& info) { - TString cName = info.GetDebugInfo().GetCodecName(); + TString GetStandardFileName(const TStaticCodecInfo& info) { + TString cName = info.GetDebugInfo().GetCodecName(); SubstGlobal(cName, ':', '.'); return TStringBuilder() << cName << "." << info.GetDebugInfo().GetTimestamp() << ".codec_info"; } diff --git a/library/cpp/codecs/static/builder.h b/library/cpp/codecs/static/builder.h index d7533be4d5..f179d77861 100644 --- a/library/cpp/codecs/static/builder.h +++ b/library/cpp/codecs/static/builder.h @@ -5,25 +5,25 @@ #include <library/cpp/svnversion/svnversion.h> #include <util/datetime/base.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/vector.h> #include <util/string/builder.h> namespace NCodecs { struct TCodecBuildInfo { // optimal values from SEARCH-1655 - TString CodecName = "solar-8k-a:zstd08d-1"; + TString CodecName = "solar-8k-a:zstd08d-1"; float SampleSizeMultiplier = 1; // debug info: time_t Timestamp = TInstant::Now().TimeT(); - TString RevisionInfo = (TStringBuilder() << "r" << ToString(GetProgramSvnRevision())); - TString TrainingSetComment; // a human comment on the training data + TString RevisionInfo = (TStringBuilder() << "r" << ToString(GetProgramSvnRevision())); + TString TrainingSetComment; // a human comment on the training data TString TrainingSetResId; // sandbox resid of the training set }; - TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo&); + TStaticCodecInfo BuildStaticCodec(const TVector<TString>& trainingData, const TCodecBuildInfo&); - TString GetStandardFileName(const TStaticCodecInfo&); + TString GetStandardFileName(const TStaticCodecInfo&); } diff --git a/library/cpp/codecs/static/common.h b/library/cpp/codecs/static/common.h index 211de2a27d..588975b8de 100644 --- a/library/cpp/codecs/static/common.h +++ b/library/cpp/codecs/static/common.h @@ -12,10 +12,10 @@ namespace NCodecs { } template <class T> - TString HexWriteScalar(T t) { + TString HexWriteScalar(T t) { static_assert(std::is_scalar<T>::value, "scalars only"); t = LittleToBig(t); - TString res = HexEncode(&t, sizeof(t)); + TString res = HexEncode(&t, sizeof(t)); res.to_lower(); return res; } diff --git a/library/cpp/codecs/static/static.cpp b/library/cpp/codecs/static/static.cpp index 44a07dd73a..2c84c90d9c 100644 --- a/library/cpp/codecs/static/static.cpp +++ b/library/cpp/codecs/static/static.cpp @@ -50,7 +50,7 @@ namespace NCodecs { return result; } - TString SaveCodecInfoToString(const TStaticCodecInfo& info) { + TString SaveCodecInfoToString(const TStaticCodecInfo& info) { TStringStream s; SaveCodecInfoToStream(s, info); return s.Str(); @@ -61,7 +61,7 @@ namespace NCodecs { return LoadCodecInfoFromStream(m); } - TString FormatCodecInfo(const TStaticCodecInfo& ci) { + TString FormatCodecInfo(const TStaticCodecInfo& ci) { TStringBuilder s; s << "codec name: " << ci.GetDebugInfo().GetCodecName() << Endl; s << "codec hash: " << HexWriteScalar(ci.GetDebugInfo().GetStoredCodecHash()) << Endl; @@ -77,7 +77,7 @@ namespace NCodecs { return s; } - TString LoadStringFromArchive(const ui8* begin, size_t size) { + TString LoadStringFromArchive(const ui8* begin, size_t size) { TArchiveReader ar(TBlob::NoCopy(begin, size)); Y_VERIFY(ar.Count() == 1, "invalid number of entries"); auto blob = ar.ObjectBlobByKey(ar.KeyByIndex(0)); diff --git a/library/cpp/codecs/static/static.h b/library/cpp/codecs/static/static.h index c1eaed2a74..9a2fa5a1d7 100644 --- a/library/cpp/codecs/static/static.h +++ b/library/cpp/codecs/static/static.h @@ -3,7 +3,7 @@ #include <library/cpp/codecs/codecs.h> #include <util/generic/strbuf.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/stream/output.h> namespace NCodecs { @@ -15,13 +15,13 @@ namespace NCodecs { TStaticCodecInfo LoadCodecInfoFromString(TStringBuf data); - TString LoadStringFromArchive(const ui8* begin, size_t size); + TString LoadStringFromArchive(const ui8* begin, size_t size); TCodecConstPtr RestoreCodecFromArchive(const ui8* begin, size_t size); // save - TString SaveCodecInfoToString(const TStaticCodecInfo&); + TString SaveCodecInfoToString(const TStaticCodecInfo&); void SaveCodecInfoToStream(IOutputStream& out, const TStaticCodecInfo&); @@ -29,6 +29,6 @@ namespace NCodecs { TStaticCodecInfo LoadCodecInfoFromStream(IInputStream& in); - TString FormatCodecInfo(const TStaticCodecInfo&); + TString FormatCodecInfo(const TStaticCodecInfo&); } diff --git a/library/cpp/codecs/static/tools/common/ct_common.cpp b/library/cpp/codecs/static/tools/common/ct_common.cpp index fe77691280..ab4a2fac3f 100644 --- a/library/cpp/codecs/static/tools/common/ct_common.cpp +++ b/library/cpp/codecs/static/tools/common/ct_common.cpp @@ -9,7 +9,7 @@ #include <util/system/hp_timer.h> namespace NCodecs { - TString TComprStats::Format(const TStaticCodecInfo& info, bool checkMode) const { + TString TComprStats::Format(const TStaticCodecInfo& info, bool checkMode) const { TStringBuilder s; s << "raw size/item: " << RawSizePerRecord() << Endl; s << "enc.size/item: " << EncSizePerRecord() << Endl; @@ -26,7 +26,7 @@ namespace NCodecs { return s; } - TComprStats TestCodec(const ICodec& c, const TVector<TString>& input) { + TComprStats TestCodec(const ICodec& c, const TVector<TString>& input) { TComprStats stats; TBuffer encodeBuffer; @@ -51,10 +51,10 @@ namespace NCodecs { return stats; } - void ParseBlob(TVector<TString>& result, EDataStreamFormat fmt, const TBlob& blob) { + void ParseBlob(TVector<TString>& result, EDataStreamFormat fmt, const TBlob& blob) { TStringBuf bin(blob.AsCharPtr(), blob.Size()); TStringBuf line; - TString buffer; + TString buffer; while (bin.ReadLine(line)) { if (DSF_BASE64_LF == fmt) { Base64Decode(line, buffer); @@ -67,7 +67,7 @@ namespace NCodecs { } } - TBlob GetInputBlob(const TString& dataFile) { + TBlob GetInputBlob(const TString& dataFile) { return dataFile && dataFile != "-" ? TBlob::FromFile(dataFile) : TBlob::FromStream(Cin); } diff --git a/library/cpp/codecs/static/tools/common/ct_common.h b/library/cpp/codecs/static/tools/common/ct_common.h index 9d3dcbda93..a66c476c3d 100644 --- a/library/cpp/codecs/static/tools/common/ct_common.h +++ b/library/cpp/codecs/static/tools/common/ct_common.h @@ -1,6 +1,6 @@ #pragma once -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/vector.h> #include <util/memory/blob.h> #include <cmath> @@ -57,10 +57,10 @@ namespace NCodecs { return PerRecord((1 - compr) * RawSize); } - TString Format(const TStaticCodecInfo&, bool checkMode) const; + TString Format(const TStaticCodecInfo&, bool checkMode) const; }; - TComprStats TestCodec(const ICodec&, const TVector<TString>& data); + TComprStats TestCodec(const ICodec&, const TVector<TString>& data); enum EDataStreamFormat { DSF_NONE, @@ -68,8 +68,8 @@ namespace NCodecs { DSF_BASE64_LF /* "base64" */, }; - void ParseBlob(TVector<TString>&, EDataStreamFormat, const TBlob&); + void ParseBlob(TVector<TString>&, EDataStreamFormat, const TBlob&); - TBlob GetInputBlob(const TString& dataFile); + TBlob GetInputBlob(const TString& dataFile); } diff --git a/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp b/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp index 9c8d568d82..1775a07303 100644 --- a/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp +++ b/library/cpp/codecs/static/tools/static_codec_checker/static_codec_checker.cpp @@ -14,7 +14,7 @@ int main(int argc, char** argv) { NCodecs::TCodecPtr codecPtr; NCodecs::EDataStreamFormat fmt = NCodecs::DSF_NONE; - TString codecFile; + TString codecFile; bool testCompression = false; auto opts = NLastGetopt::TOpts::Default(); @@ -50,7 +50,7 @@ int main(int argc, char** argv) { Cout << "Reading testing set data ... " << Flush; - TVector<TString> allData; + TVector<TString> allData; for (const auto& freeArg : res.GetFreeArgs()) { NCodecs::ParseBlob(allData, fmt, NCodecs::GetInputBlob(freeArg)); } diff --git a/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp b/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp index 45fdb5c5fe..c5b4f0fcde 100644 --- a/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp +++ b/library/cpp/codecs/static/tools/static_codec_generator/static_codec_generator.cpp @@ -44,7 +44,7 @@ int main(int argc, char** argv) { NLastGetopt::TOptsParseResult res(&opts, argc, argv); Cout << "Reading training set data ... " << Flush; - TVector<TString> allData; + TVector<TString> allData; for (const auto& freeArg : res.GetFreeArgs()) { NCodecs::ParseBlob(allData, fmt, NCodecs::GetInputBlob(freeArg)); } @@ -61,7 +61,7 @@ int main(int argc, char** argv) { auto codec = NCodecs::BuildStaticCodec(allData, info); Cout << "Done" << Endl; - TString codecName = NCodecs::GetStandardFileName(codec); + TString codecName = NCodecs::GetStandardFileName(codec); NCodecs::TCodecPtr codecPtr = NCodecs::ICodec::RestoreFromString(codec.GetStoredCodec()); Cout << "Testing compression ... " << Flush; @@ -74,7 +74,7 @@ int main(int argc, char** argv) { Cout << "Saving as " << codecName << " ... " << Flush; { - TUnbufferedFileOutput fout{codecName}; + TUnbufferedFileOutput fout{codecName}; NCodecs::SaveCodecInfoToStream(fout, codec); fout.Finish(); } diff --git a/library/cpp/codecs/static/ut/builder_ut.cpp b/library/cpp/codecs/static/ut/builder_ut.cpp index b47c279ed1..e4b207d132 100644 --- a/library/cpp/codecs/static/ut/builder_ut.cpp +++ b/library/cpp/codecs/static/ut/builder_ut.cpp @@ -9,16 +9,16 @@ class TStaticCodecInfoBuilderTest: public NUnitTest::TTestBase { UNIT_TEST_SUITE_END(); private: - TVector<TString> PrepareData() { - TVector<TString> data; + TVector<TString> PrepareData() { + TVector<TString> data; for (ui32 i = 'a'; i <= 'z'; ++i) { - data.push_back(TString(1, (char)i)); + data.push_back(TString(1, (char)i)); } return data; } void TestBuild() { - TVector<TString> data; + TVector<TString> data; NCodecs::TCodecBuildInfo info; info.CodecName = "huffman"; info.SampleSizeMultiplier = 2; diff --git a/library/cpp/codecs/ut/codecs_ut.cpp b/library/cpp/codecs/ut/codecs_ut.cpp index caf6089aef..581650a65b 100644 --- a/library/cpp/codecs/ut/codecs_ut.cpp +++ b/library/cpp/codecs/ut/codecs_ut.cpp @@ -872,8 +872,8 @@ class TCodecsTest: public TTestBase { UNIT_TEST_SUITE_END(); private: - TString PrintError(TStringBuf learn, TStringBuf test, TStringBuf codec, ui32 i) { - TString s; + TString PrintError(TStringBuf learn, TStringBuf test, TStringBuf codec, ui32 i) { + TString s; TStringOutput sout(s); sout << codec << ": " << i << ", " << "\n"; @@ -882,7 +882,7 @@ private: sout << HexEncode(test.data(), test.size()); //NEscJ::EscapeJ<true>(test, sout); if (s.Size() > 1536) { - TString res = s.substr(0, 512); + TString res = s.substr(0, 512); res.append("...<skipped ").append(ToString(s.size() - 1024)).append(">..."); res.append(s.substr(s.size() - 512)); } @@ -895,13 +895,13 @@ private: } template <typename TCodec, bool testsaveload> - void TestCodec(const TVector<TBuffer>& inlearn = TVector<TBuffer>(), const TVector<TBuffer>& in = TVector<TBuffer>(), NCodecs::TCodecPtr c = new TCodec) { + void TestCodec(const TVector<TBuffer>& inlearn = TVector<TBuffer>(), const TVector<TBuffer>& in = TVector<TBuffer>(), NCodecs::TCodecPtr c = new TCodec) { using namespace NCodecs; TBuffer buff; { - TVector<TBuffer> out; + TVector<TBuffer> out; c->Learn(inlearn.begin(), inlearn.end()); @@ -973,7 +973,7 @@ private: void TestDelta() { using namespace NCodecs; - TVector<TBuffer> d; + TVector<TBuffer> d; // 1. common case d.emplace_back(); @@ -1016,7 +1016,7 @@ private: void TestPFor() { using namespace NCodecs; { - TVector<TBuffer> d; + TVector<TBuffer> d; d.emplace_back(); AppendTo(d.back(), -1LL); AppendTo(d.back(), -1LL); @@ -1054,7 +1054,7 @@ private: TestCodec<TPForCodec<ui64, true>, true>(d); } { - TVector<TBuffer> d; + TVector<TBuffer> d; d.emplace_back(); AppendTo(d.back(), -1); AppendTo(d.back(), -1); @@ -1084,7 +1084,7 @@ private: TestCodec<TPForCodec<ui32, true>, false>(d); } { - TVector<TBuffer> d; + TVector<TBuffer> d; d.emplace_back(); for (auto& textValue : TextValues) { AppendTo(d.back(), (ui32)strlen(textValue)); @@ -1094,7 +1094,7 @@ private: TestCodec<TPForCodec<ui32, true>, false>(d); } { - TVector<TBuffer> d; + TVector<TBuffer> d; d.emplace_back(); for (auto& textValue : TextValues) { AppendTo(d.back(), (ui64)strlen(textValue)); @@ -1109,7 +1109,7 @@ private: void DoTestSimpleCodec() { using namespace NCodecs; { - TVector<TBuffer> learn; + TVector<TBuffer> learn; for (auto& textValue : TextValues) { learn.emplace_back(textValue, strlen(textValue)); @@ -1122,11 +1122,11 @@ private: } { - TVector<TBuffer> learn; + TVector<TBuffer> learn; learn.emplace_back(); learn.back().Append('a'); - TVector<TBuffer> test; + TVector<TBuffer> test; test.emplace_back(); for (ui32 i = 0; i < 256; ++i) { test.back().Append((ui8)i); @@ -1136,7 +1136,7 @@ private: } { - TVector<TBuffer> learn; + TVector<TBuffer> learn; learn.emplace_back(); for (ui32 i = 0; i < 256; ++i) { for (ui32 j = 0; j < i; ++j) { @@ -1144,7 +1144,7 @@ private: } } - TVector<TBuffer> test; + TVector<TBuffer> test; test.emplace_back(); for (ui32 i = 0; i < 256; ++i) { test.back().Append((ui8)i); @@ -1154,7 +1154,7 @@ private: } { - TVector<TBuffer> learn; + TVector<TBuffer> learn; learn.emplace_back(); for (ui32 i = 0; i < 128; ++i) { for (ui32 j = 0; j < i; ++j) { @@ -1162,7 +1162,7 @@ private: } } - TVector<TBuffer> test; + TVector<TBuffer> test; test.emplace_back(); for (ui32 i = 128; i < 256; ++i) { test.back().Append((ui8)i); @@ -1197,13 +1197,13 @@ private: void TestHuffmanLearnByFreqs() { using namespace NCodecs; - TVector<TBuffer> data; + TVector<TBuffer> data; for (auto& textValue : TextValues) { data.emplace_back(textValue, strlen(textValue)); } - TVector<TBuffer> outLearn; + TVector<TBuffer> outLearn; { THuffmanCodec codec; @@ -1215,7 +1215,7 @@ private: } } - TVector<TBuffer> outLearnByFreqs; + TVector<TBuffer> outLearnByFreqs; { THuffmanCodec codec; @@ -1251,30 +1251,30 @@ private: void TestSolar() { using namespace NCodecs; { - TVector<TBuffer> learn; + TVector<TBuffer> learn; for (auto& textValue : TextValues) { learn.emplace_back(textValue, strlen(textValue)); } - TestCodec<TSolarCodec, true>(learn, TVector<TBuffer>(), new TSolarCodec(512, 8)); - TestCodec<TAdaptiveSolarCodec, false>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); - TestCodec<TAdaptiveSolarCodec, true>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); - TestCodec<TSolarCodecShortInt, true>(learn, TVector<TBuffer>(), new TSolarCodecShortInt(512, 8)); + TestCodec<TSolarCodec, true>(learn, TVector<TBuffer>(), new TSolarCodec(512, 8)); + TestCodec<TAdaptiveSolarCodec, false>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); + TestCodec<TAdaptiveSolarCodec, true>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); + TestCodec<TSolarCodecShortInt, true>(learn, TVector<TBuffer>(), new TSolarCodecShortInt(512, 8)); } { - TestCodec<TSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodec(512, 8)); - TestCodec<TAdaptiveSolarCodec, false>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); - TestCodec<TAdaptiveSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); - TestCodec<TSolarCodecShortInt, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodecShortInt(512, 8)); + TestCodec<TSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodec(512, 8)); + TestCodec<TAdaptiveSolarCodec, false>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); + TestCodec<TAdaptiveSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8)); + TestCodec<TSolarCodecShortInt, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodecShortInt(512, 8)); } { - TVector<TBuffer> learn; + TVector<TBuffer> learn; learn.emplace_back(); learn.back().Append('a'); - TVector<TBuffer> test; + TVector<TBuffer> test; test.emplace_back(); for (ui32 i = 0; i < 256; ++i) { test.back().Append((ui8)i); @@ -1287,7 +1287,7 @@ private: } { - TVector<TBuffer> learn; + TVector<TBuffer> learn; learn.emplace_back(); for (ui32 i = 0; i < 256; ++i) { for (ui32 j = 0; j < i; ++j) { @@ -1295,7 +1295,7 @@ private: } } - TVector<TBuffer> test; + TVector<TBuffer> test; test.emplace_back(); for (ui32 i = 0; i < 256; ++i) { test.back().Append((ui8)i); @@ -1311,7 +1311,7 @@ private: void TestPipeline() { using namespace NCodecs; { - TVector<TBuffer> learn; + TVector<TBuffer> learn; learn.emplace_back(); for (ui32 i = 0; i < 256; ++i) { for (i32 j = i; j >= 0; --j) { @@ -1319,7 +1319,7 @@ private: } } - TVector<TBuffer> test; + TVector<TBuffer> test; test.emplace_back(); for (ui32 i = 0; i < 256; ++i) { test.back().Append((ui8)i); @@ -1329,7 +1329,7 @@ private: new TPipelineCodec(new TSolarCodec(512, 8), new TSolarCodec(512, 8), new THuffmanCodec)); } { - TVector<TBuffer> d; + TVector<TBuffer> d; d.emplace_back(); for (ui32 i = 0; i < 256; ++i) { for (i32 j = i; j >= 0; --j) { @@ -1337,14 +1337,14 @@ private: } } - TestCodec<TPipelineCodec, false>(d, TVector<TBuffer>(), + TestCodec<TPipelineCodec, false>(d, TVector<TBuffer>(), new TPipelineCodec(new TDeltaCodec<ui32, false>, new TPForCodec<ui32>)); } } void TestRegistry() { using namespace NCodecs; - TVector<TString> vs = ICodec::GetCodecsList(); + TVector<TString> vs = ICodec::GetCodecsList(); for (const auto& v : vs) { TCodecPtr p = ICodec::GetInstance(v); if (v == "none") { diff --git a/library/cpp/codecs/ut/float_huffman_ut.cpp b/library/cpp/codecs/ut/float_huffman_ut.cpp index 3156fb1f46..d9bda02850 100644 --- a/library/cpp/codecs/ut/float_huffman_ut.cpp +++ b/library/cpp/codecs/ut/float_huffman_ut.cpp @@ -142,7 +142,7 @@ Y_UNIT_TEST_SUITE(FloatHuffmanTest) { } // Helper for dumping compressed values - void PrintCompressed(const TVector<ui8>& codedFactors) { + void PrintCompressed(const TVector<ui8>& codedFactors) { for (size_t i = 0; i < codedFactors.size(); ++i) { if (i % 0x10 == 0) Cerr << Endl; @@ -152,7 +152,7 @@ Y_UNIT_TEST_SUITE(FloatHuffmanTest) { } // Helper for dumping decompressed values - void PrintDecompressed(const TVector<float>& factors) { + void PrintDecompressed(const TVector<float>& factors) { TStringStream result; TStringStream line; @@ -220,7 +220,7 @@ Y_UNIT_TEST_SUITE(FloatHuffmanTest) { Y_UNIT_TEST(TestDecompressForgedData) { // this coredumps without end-of-coded-stream check, see SEARCH-1156 for details - TString brokenBase64Encoded = + TString brokenBase64Encoded = "NLjYltUWs5pqnd3d3f05Li4OAwCAEqrP6mv06jDt7PiAUVu7Y+PiMpuZmdzeM" "ArqOLxS2q4FKCII52dktcVs7y0zL+OKgeO9SOzEkFj7uPfFqqoCAAAAAADAtZ" "mZ2fdmICAgANQXhi1WVRUAAAAAAAAGjvcWq6oKAAAAAAAAA8d7qe4rV3Nxcd3" diff --git a/library/cpp/codecs/zstd_dict_codec.cpp b/library/cpp/codecs/zstd_dict_codec.cpp index c42a2879e6..d04ea57f3b 100644 --- a/library/cpp/codecs/zstd_dict_codec.cpp +++ b/library/cpp/codecs/zstd_dict_codec.cpp @@ -147,7 +147,7 @@ namespace NCodecs { bool Learn(ISequenceReader& in, bool throwOnError) { TBuffer data; - TVector<size_t> lens; + TVector<size_t> lens; data.Reserve(2 * SampleSize); TStringBuf r; @@ -233,7 +233,7 @@ namespace NCodecs { TZStdDictCodec::~TZStdDictCodec() { } - TString TZStdDictCodec::GetName() const { + TString TZStdDictCodec::GetName() const { return TStringBuilder() << MyName() << "-" << Impl->GetCompressionLevel(); } @@ -263,8 +263,8 @@ namespace NCodecs { Impl->Load(in); } - TVector<TString> TZStdDictCodec::ListCompressionNames() { - TVector<TString> res; + TVector<TString> TZStdDictCodec::ListCompressionNames() { + TVector<TString> res; for (int i = 1; i <= ZSTD_maxCLevel(); ++i) { res.emplace_back(TStringBuilder() << MyName() << "-" << i); } |