diff options
author | filmih <filmih@yandex-team.ru> | 2022-02-10 16:49:59 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:59 +0300 |
commit | 693ca74a6530df8930b0d445102e2ea77b8c4e00 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library | |
parent | 883c643baf3a1698f0f0a31a8973b61411cd311f (diff) | |
download | ydb-693ca74a6530df8930b0d445102e2ea77b8c4e00.tar.gz |
Restoring authorship annotation for <filmih@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/codecs/greedy_dict/gd_builder.cpp | 2 | ||||
-rw-r--r-- | library/cpp/containers/comptrie/comptrie_impl.cpp | 2 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io.cpp | 24 | ||||
-rw-r--r-- | library/cpp/protobuf/util/pb_io.h | 8 | ||||
-rw-r--r-- | library/cpp/testing/unittest/registar.cpp | 2 | ||||
-rw-r--r-- | library/cpp/unicode/normalization/normalization.h | 82 | ||||
-rw-r--r-- | library/cpp/unicode/normalization/ya.make | 2 |
7 files changed, 61 insertions, 61 deletions
diff --git a/library/cpp/codecs/greedy_dict/gd_builder.cpp b/library/cpp/codecs/greedy_dict/gd_builder.cpp index 7788771427..561bfbca01 100644 --- a/library/cpp/codecs/greedy_dict/gd_builder.cpp +++ b/library/cpp/codecs/greedy_dict/gd_builder.cpp @@ -125,7 +125,7 @@ namespace NGreedyDict { if (Settings.Verbose) { TString mess = Sprintf("iter:%" PRIu32 " sz:%" PRIu32 " pend:%" PRIu32, maxiters, (ui32)Current->size(), (ui32)CompoundCounts->size()); - Clog << Sprintf("%-110s RSS=%" PRIu32 "M", mess.data(), (ui32)(TRusage::Get().MaxRss >> 20)) << Endl; + Clog << Sprintf("%-110s RSS=%" PRIu32 "M", mess.data(), (ui32)(TRusage::Get().MaxRss >> 20)) << Endl; } ui32 diff = BuildNextGeneration(maxentries); diff --git a/library/cpp/containers/comptrie/comptrie_impl.cpp b/library/cpp/containers/comptrie/comptrie_impl.cpp index 892fac1d48..a116ab6d1e 100644 --- a/library/cpp/containers/comptrie/comptrie_impl.cpp +++ b/library/cpp/containers/comptrie/comptrie_impl.cpp @@ -31,7 +31,7 @@ namespace NCompactTrie { void ShowProgress(size_t n) { if (n % 1000000 == 0) - Cerr << n << ", RSS=" << (TRusage::Get().MaxRss >> 20) << "mb" << Endl; + Cerr << n << ", RSS=" << (TRusage::Get().MaxRss >> 20) << "mb" << Endl; else if (n % 20000 == 0) Cerr << "."; } diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp index bbedfa16fa..6270ee0624 100644 --- a/library/cpp/protobuf/util/pb_io.cpp +++ b/library/cpp/protobuf/util/pb_io.cpp @@ -118,18 +118,18 @@ void SerializeToTextFormatWithEnumId(const NProtoBuf::Message& m, IOutputStream& } } -void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out) { - google::protobuf::TextFormat::Printer printer; - printer.SetUseUtf8StringEscaping(true); - printer.SetUseShortRepeatedPrimitives(true); - - NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out); - - if (!printer.Print(m, &adaptor)) { - ythrow yexception() << "SerializeToTextFormatPretty failed on Print"; - } -} - +void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out) { + google::protobuf::TextFormat::Printer printer; + printer.SetUseUtf8StringEscaping(true); + printer.SetUseShortRepeatedPrimitives(true); + + NProtoBuf::io::TCopyingOutputStreamAdaptor adaptor(&out); + + if (!printer.Print(m, &adaptor)) { + ythrow yexception() << "SerializeToTextFormatPretty failed on Print"; + } +} + static void ConfigureParser(const EParseFromTextFormatOptions options, NProtoBuf::TextFormat::Parser& p) { if (options & EParseFromTextFormatOption::AllowUnknownField) { diff --git a/library/cpp/protobuf/util/pb_io.h b/library/cpp/protobuf/util/pb_io.h index 089191c19e..493c84cb5f 100644 --- a/library/cpp/protobuf/util/pb_io.h +++ b/library/cpp/protobuf/util/pb_io.h @@ -48,10 +48,10 @@ int operator&(NProtoBuf::Message& m, IBinSaver& f); void SerializeToTextFormat(const NProtoBuf::Message& m, const TString& fileName); void SerializeToTextFormat(const NProtoBuf::Message& m, IOutputStream& out); -// Write a textual representation of the given message to the given output stream -// with flags UseShortRepeatedPrimitives and UseUtf8StringEscaping set to true. -void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out); - +// Write a textual representation of the given message to the given output stream +// with flags UseShortRepeatedPrimitives and UseUtf8StringEscaping set to true. +void SerializeToTextFormatPretty(const NProtoBuf::Message& m, IOutputStream& out); + // Write a textual representation of the given message to the given output stream // use enum id instead of enum name for all enum fields. void SerializeToTextFormatWithEnumId(const NProtoBuf::Message& m, IOutputStream& out); diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp index 471e00c639..3679b768ed 100644 --- a/library/cpp/testing/unittest/registar.cpp +++ b/library/cpp/testing/unittest/registar.cpp @@ -340,7 +340,7 @@ void NUnitTest::TTestBase::BeforeTest(const char* func) { void NUnitTest::TTestBase::Finish(const char* func, TTestContext* context) { TRusage finishRusage = TRusage::Get(); - context->Metrics["ru_rss"] = finishRusage.MaxRss - rusage.MaxRss; + context->Metrics["ru_rss"] = finishRusage.MaxRss - rusage.MaxRss; context->Metrics["ru_major_pagefaults"] = finishRusage.MajorPageFaults - rusage.MajorPageFaults; context->Metrics["ru_utime"] = (finishRusage.Utime - rusage.Utime).MicroSeconds(); context->Metrics["ru_stime"] = (finishRusage.Stime - rusage.Stime).MicroSeconds(); diff --git a/library/cpp/unicode/normalization/normalization.h b/library/cpp/unicode/normalization/normalization.h index 1537054f2a..4f5f57881c 100644 --- a/library/cpp/unicode/normalization/normalization.h +++ b/library/cpp/unicode/normalization/normalization.h @@ -187,10 +187,10 @@ namespace NUnicode { } }; - template <ENormalization N, typename TCharType> - inline bool Normalized(const TCharType* begin, const TCharType* end) { + template <ENormalization N, typename TCharType> + inline bool Normalized(const TCharType* begin, const TCharType* end) { TCombining lastCanonicalClass = 0; - for (const TCharType* i = begin; i != end;) { + for (const TCharType* i = begin; i != end;) { wchar32 ch = ReadSymbolAndAdvance(i, end); TCombining canonicalClass = DecompositionCombining(ch); @@ -244,12 +244,12 @@ namespace NUnicode { } } - static inline void Write(const TBuffer::const_iterator& begin, const TBuffer::const_iterator& end, TUtf32String& out) { // because WriteSymbol from util/charset/wide.h works wrong in this case - for (TBuffer::const_iterator i = begin; i != end; ++i) { - out += i->first; - } - } - + static inline void Write(const TBuffer::const_iterator& begin, const TBuffer::const_iterator& end, TUtf32String& out) { // because WriteSymbol from util/charset/wide.h works wrong in this case + for (TBuffer::const_iterator i = begin; i != end; ++i) { + out += i->first; + } + } + inline void SortBuffer() { if (Buffer.size() < 2) return; @@ -289,11 +289,11 @@ namespace NUnicode { } } - template <class T, typename TCharType> - inline void DoNormalize(const TCharType* begin, const TCharType* end, T& out) { + template <class T, typename TCharType> + inline void DoNormalize(const TCharType* begin, const TCharType* end, T& out) { Buffer.clear(); - for (const TCharType* i = begin; i != end;) { + for (const TCharType* i = begin; i != end;) { AddChar(ReadSymbolAndAdvance(i, end), out); } @@ -313,10 +313,10 @@ namespace NUnicode { { } - template <class T, typename TCharType> - inline void Normalize(const TCharType* begin, const TCharType* end, T& out) { + template <class T, typename TCharType> + inline void Normalize(const TCharType* begin, const TCharType* end, T& out) { if (NPrivate::Normalized<Norm>(begin, end)) { - for (const TCharType* i = begin; i != end; ++i) { + for (const TCharType* i = begin; i != end; ++i) { WriteSymbol(*i, out); } } else { @@ -324,29 +324,29 @@ namespace NUnicode { } } - template <typename TCharType> - inline void Normalize(const TCharType* begin, const TCharType* end, TUtf32String& out) { - if (NPrivate::Normalized<Norm>(begin, end)) { - for (const TCharType* i = begin; i != end;) { - out += ReadSymbolAndAdvance(i, end); - } - } else { - DoNormalize(begin, end, out); - } - } - - template <class T, typename TCharType> - inline void Normalize(const TCharType* begin, size_t len, T& out) { + template <typename TCharType> + inline void Normalize(const TCharType* begin, const TCharType* end, TUtf32String& out) { + if (NPrivate::Normalized<Norm>(begin, end)) { + for (const TCharType* i = begin; i != end;) { + out += ReadSymbolAndAdvance(i, end); + } + } else { + DoNormalize(begin, end, out); + } + } + + template <class T, typename TCharType> + inline void Normalize(const TCharType* begin, size_t len, T& out) { return Normalize(begin, begin + len, out); } - template <typename TCharType> - inline TBasicString<TCharType> Normalize(const TBasicString<TCharType>& src) { + template <typename TCharType> + inline TBasicString<TCharType> Normalize(const TBasicString<TCharType>& src) { if (NPrivate::Normalized<Norm>(src.begin(), src.end())) { // nothing to normalize return src; } else { - TBasicString<TCharType> res; + TBasicString<TCharType> res; res.reserve(src.length()); DoNormalize(src.begin(), src.end(), res); return res; @@ -355,16 +355,16 @@ namespace NUnicode { }; } -//! decompose utf16 or utf32 string to any container supporting push_back or to T* -template <NUnicode::ENormalization Norm, class T, typename TCharType> -inline void Normalize(const TCharType* begin, size_t len, T& out) { +//! decompose utf16 or utf32 string to any container supporting push_back or to T* +template <NUnicode::ENormalization Norm, class T, typename TCharType> +inline void Normalize(const TCharType* begin, size_t len, T& out) { ::NUnicode::TNormalizer<Norm> dec; dec.Normalize(begin, len, out); } -template <NUnicode::ENormalization N, typename TCharType> -inline TBasicString<TCharType> Normalize(const TCharType* str, size_t len) { - TBasicString<TCharType> res; +template <NUnicode::ENormalization N, typename TCharType> +inline TBasicString<TCharType> Normalize(const TCharType* str, size_t len) { + TBasicString<TCharType> res; res.reserve(len); Normalize<N>(str, len, res); @@ -372,13 +372,13 @@ inline TBasicString<TCharType> Normalize(const TCharType* str, size_t len) { return res; } -template <NUnicode::ENormalization N, typename TCharType> -inline TBasicString<TCharType> Normalize(const TBasicString<TCharType>& str) { +template <NUnicode::ENormalization N, typename TCharType> +inline TBasicString<TCharType> Normalize(const TBasicString<TCharType>& str) { ::NUnicode::TNormalizer<N> dec; return dec.Normalize(str); } -template <NUnicode::ENormalization N, typename TCharType> -inline TBasicString<TCharType> Normalize(const TBasicStringBuf<TCharType> str) { +template <NUnicode::ENormalization N, typename TCharType> +inline TBasicString<TCharType> Normalize(const TBasicStringBuf<TCharType> str) { return Normalize<N>(str.data(), str.size()); } diff --git a/library/cpp/unicode/normalization/ya.make b/library/cpp/unicode/normalization/ya.make index f6671ff4bc..95bc93f297 100644 --- a/library/cpp/unicode/normalization/ya.make +++ b/library/cpp/unicode/normalization/ya.make @@ -18,7 +18,7 @@ IF(NOT CATBOOST_OPENSOURCE) PEERDIR( library/cpp/charset ) - GENERATE_ENUM_SERIALIZATION(normalization.h) + GENERATE_ENUM_SERIALIZATION(normalization.h) ENDIF() END() |