diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/codecs/static | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/codecs/static')
-rw-r--r-- | library/cpp/codecs/static/common.h | 4 | ||||
-rw-r--r-- | library/cpp/codecs/static/static.cpp | 12 | ||||
-rw-r--r-- | library/cpp/codecs/static/tools/common/ct_common.cpp | 12 | ||||
-rw-r--r-- | library/cpp/codecs/static/ut/static_ut.cpp | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/codecs/static/common.h b/library/cpp/codecs/static/common.h index 211de2a27d..dec4046a21 100644 --- a/library/cpp/codecs/static/common.h +++ b/library/cpp/codecs/static/common.h @@ -8,7 +8,7 @@ namespace NCodecs { template <class T> ui64 DataSignature(const T& t) { static_assert(!std::is_scalar<T>::value, "no scalars"); - return CityHash64(t.data(), t.size()); + return CityHash64(t.data(), t.size()); } template <class T> @@ -24,7 +24,7 @@ namespace NCodecs { T HexReadScalar(TStringBuf s) { static_assert(std::is_scalar<T>::value, "scalars only"); T t = 0; - HexDecode(s.data(), Min(s.size(), sizeof(T)), &t); + HexDecode(s.data(), Min(s.size(), sizeof(T)), &t); t = BigToLittle(t); return t; } diff --git a/library/cpp/codecs/static/static.cpp b/library/cpp/codecs/static/static.cpp index 44a07dd73a..71d1f1cce0 100644 --- a/library/cpp/codecs/static/static.cpp +++ b/library/cpp/codecs/static/static.cpp @@ -31,10 +31,10 @@ namespace NCodecs { TStaticCodecInfo LoadCodecInfoFromStream(IInputStream& in) { { TBuffer magic; - magic.Resize(GetStaticCodecInfoMagic().size()); - Y_ENSURE_EX(in.Read(magic.Data(), GetStaticCodecInfoMagic().size()) == GetStaticCodecInfoMagic().size(), + magic.Resize(GetStaticCodecInfoMagic().size()); + Y_ENSURE_EX(in.Read(magic.Data(), GetStaticCodecInfoMagic().size()) == GetStaticCodecInfoMagic().size(), TCodecException() << "bad codec info"); - Y_ENSURE_EX(TStringBuf(magic.data(), magic.size()) == GetStaticCodecInfoMagic(), + Y_ENSURE_EX(TStringBuf(magic.data(), magic.size()) == GetStaticCodecInfoMagic(), TCodecException() << "bad codec info"); } @@ -45,7 +45,7 @@ namespace NCodecs { Y_ENSURE_EX(hash == DataSignature(info), TCodecException() << "bad codec info"); TStaticCodecInfo result; - Y_ENSURE_EX(result.ParseFromArray(info.data(), info.size()), TCodecException() << "bad codec info"); + Y_ENSURE_EX(result.ParseFromArray(info.data(), info.size()), TCodecException() << "bad codec info"); return result; } @@ -57,7 +57,7 @@ namespace NCodecs { } TStaticCodecInfo LoadCodecInfoFromString(TStringBuf data) { - TMemoryInput m{data.data(), data.size()}; + TMemoryInput m{data.data(), data.size()}; return LoadCodecInfoFromStream(m); } @@ -81,7 +81,7 @@ namespace NCodecs { TArchiveReader ar(TBlob::NoCopy(begin, size)); Y_VERIFY(ar.Count() == 1, "invalid number of entries"); auto blob = ar.ObjectBlobByKey(ar.KeyByIndex(0)); - return TString{blob.AsCharPtr(), blob.Size()}; + return TString{blob.AsCharPtr(), blob.Size()}; } TCodecConstPtr RestoreCodecFromCodecInfo(const TStaticCodecInfo& info) { diff --git a/library/cpp/codecs/static/tools/common/ct_common.cpp b/library/cpp/codecs/static/tools/common/ct_common.cpp index fe77691280..ded3a503ff 100644 --- a/library/cpp/codecs/static/tools/common/ct_common.cpp +++ b/library/cpp/codecs/static/tools/common/ct_common.cpp @@ -36,23 +36,23 @@ namespace NCodecs { decodeBuffer.Clear(); stats.Records += 1; - stats.RawSize += data.size(); + stats.RawSize += data.size(); THPTimer timer; c.Encode(data, encodeBuffer); - stats.EncSize += encodeBuffer.size(); + stats.EncSize += encodeBuffer.size(); stats.EncSeconds += timer.PassedReset(); - c.Decode(TStringBuf{encodeBuffer.data(), encodeBuffer.size()}, decodeBuffer); + c.Decode(TStringBuf{encodeBuffer.data(), encodeBuffer.size()}, decodeBuffer); stats.DecSeconds += timer.PassedReset(); - Y_ENSURE(data == TStringBuf(decodeBuffer.data(), decodeBuffer.size()), "invalid encoding at record " << stats.Records); + Y_ENSURE(data == TStringBuf(decodeBuffer.data(), decodeBuffer.size()), "invalid encoding at record " << stats.Records); } return stats; } void ParseBlob(TVector<TString>& result, EDataStreamFormat fmt, const TBlob& blob) { - TStringBuf bin(blob.AsCharPtr(), blob.Size()); + TStringBuf bin(blob.AsCharPtr(), blob.Size()); TStringBuf line; TString buffer; while (bin.ReadLine(line)) { @@ -63,7 +63,7 @@ namespace NCodecs { if (!line) { continue; } - result.emplace_back(line.data(), line.size()); + result.emplace_back(line.data(), line.size()); } } diff --git a/library/cpp/codecs/static/ut/static_ut.cpp b/library/cpp/codecs/static/ut/static_ut.cpp index 57e1e62887..ae11e2f2d2 100644 --- a/library/cpp/codecs/static/ut/static_ut.cpp +++ b/library/cpp/codecs/static/ut/static_ut.cpp @@ -12,10 +12,10 @@ private: TBuffer outEnc, outDec; NStaticCodecExample::Encode(outEnc, letov, dv); - NStaticCodecExample::Decode(outDec, TStringBuf{outEnc.data(), outEnc.size()}); + NStaticCodecExample::Decode(outDec, TStringBuf{outEnc.data(), outEnc.size()}); UNIT_ASSERT_VALUES_EQUAL(outEnc.Size(), expectedSize); - UNIT_ASSERT_EQUAL(TStringBuf(outDec.data(), outDec.size()), letov); + UNIT_ASSERT_EQUAL(TStringBuf(outDec.data(), outDec.size()), letov); } void TestUsage() { |