diff options
| author | Vlad Yaroslavlev <[email protected]> | 2022-02-10 16:46:25 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:25 +0300 | 
| commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
| tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/yson_pull | |
| parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
Restoring authorship annotation for Vlad Yaroslavlev <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson_pull')
| -rw-r--r-- | library/cpp/yson_pull/detail/cescape.h | 22 | ||||
| -rw-r--r-- | library/cpp/yson_pull/detail/format_string.h | 6 | ||||
| -rw-r--r-- | library/cpp/yson_pull/detail/input/stream.h | 4 | ||||
| -rw-r--r-- | library/cpp/yson_pull/detail/lexer_base.h | 2 | ||||
| -rw-r--r-- | library/cpp/yson_pull/detail/output/stream.h | 4 | ||||
| -rw-r--r-- | library/cpp/yson_pull/detail/reader.h | 2 | ||||
| -rw-r--r-- | library/cpp/yson_pull/detail/writer.h | 2 | ||||
| -rw-r--r-- | library/cpp/yson_pull/exceptions.h | 8 | ||||
| -rw-r--r-- | library/cpp/yson_pull/output.cpp | 2 | ||||
| -rw-r--r-- | library/cpp/yson_pull/output.h | 2 | ||||
| -rw-r--r-- | library/cpp/yson_pull/read_ops.h | 4 | ||||
| -rw-r--r-- | library/cpp/yson_pull/ut/cescape_ut.cpp | 8 | ||||
| -rw-r--r-- | library/cpp/yson_pull/ut/loop_ut.cpp | 2 | ||||
| -rw-r--r-- | library/cpp/yson_pull/ut/writer_ut.cpp | 12 | 
14 files changed, 40 insertions, 40 deletions
| diff --git a/library/cpp/yson_pull/detail/cescape.h b/library/cpp/yson_pull/detail/cescape.h index 738e8ec32f4..1ea150e69aa 100644 --- a/library/cpp/yson_pull/detail/cescape.h +++ b/library/cpp/yson_pull/detail/cescape.h @@ -6,7 +6,7 @@  #include "macros.h"  #include <util/generic/strbuf.h> -#include <util/generic/string.h>  +#include <util/generic/string.h>  #include <util/generic/vector.h>  /* REFERENCES FOR ESCAPE SEQUENCE INTERPRETATION: @@ -38,7 +38,7 @@  namespace NYsonPull {      namespace NDetail {          namespace NCEscape { -            inline void encode(TString& dest, TStringBuf data) {  +            inline void encode(TString& dest, TStringBuf data) {                  NImpl::escape_impl(                      reinterpret_cast<const ui8*>(data.data()),                      data.size(), @@ -78,14 +78,14 @@ namespace NYsonPull {                  }              } -            inline TString encode(TStringBuf data) {  -                TString result;  +            inline TString encode(TStringBuf data) { +                TString result;                  result.reserve(data.size());                  encode(result, data);                  return result;              } -            inline void decode(TString& dest, TStringBuf data) {  +            inline void decode(TString& dest, TStringBuf data) {                  NImpl::unescape_impl(                      reinterpret_cast<const ui8*>(data.begin()),                      reinterpret_cast<const ui8*>(data.end()), @@ -97,7 +97,7 @@ namespace NYsonPull {                      });              } -            inline void decode_inplace(TVector<ui8>& data) {  +            inline void decode_inplace(TVector<ui8>& data) {                  auto* out = static_cast<ui8*>(                      ::memchr(data.data(), '\\', data.size()));                  if (out == nullptr) { @@ -116,16 +116,16 @@ namespace NYsonPull {                  data.resize(out - &data[0]);              } -            inline TString decode(TStringBuf data) {  -                TString result;  +            inline TString decode(TStringBuf data) { +                TString result;                  result.reserve(data.size());                  decode(result, data);                  return result;              }              ATTRIBUTE(noinline, cold) -            inline TString quote(TStringBuf str) {  -                TString result;  +            inline TString quote(TStringBuf str) { +                TString result;                  result.reserve(str.size() + 16);                  result += '"';                  encode(result, str); @@ -134,7 +134,7 @@ namespace NYsonPull {              }              ATTRIBUTE(noinline, cold) -            inline TString quote(ui8 ch) {  +            inline TString quote(ui8 ch) {                  char c = ch;                  return quote(TStringBuf(&c, 1));              } diff --git a/library/cpp/yson_pull/detail/format_string.h b/library/cpp/yson_pull/detail/format_string.h index 57bc2697ae1..683fd1bf361 100644 --- a/library/cpp/yson_pull/detail/format_string.h +++ b/library/cpp/yson_pull/detail/format_string.h @@ -1,7 +1,7 @@  #pragma once  #include <util/generic/strbuf.h> -#include <util/generic/string.h>  +#include <util/generic/string.h>  #include <util/string/builder.h>  namespace NYsonPull { @@ -17,10 +17,10 @@ namespace NYsonPull {          }          template <typename... Args> -        TString format_string(Args&&... args) {  +        TString format_string(Args&&... args) {              TStringBuilder builder;              NImpl::apply_args(builder, std::forward<Args>(args)...); -            return TString(std::move(builder));  +            return TString(std::move(builder));          }      }  } diff --git a/library/cpp/yson_pull/detail/input/stream.h b/library/cpp/yson_pull/detail/input/stream.h index abe495aa478..791cd5a3f52 100644 --- a/library/cpp/yson_pull/detail/input/stream.h +++ b/library/cpp/yson_pull/detail/input/stream.h @@ -57,10 +57,10 @@ namespace NYsonPull {                  }              }; -            class TFHandle: public TOwned<TFileInput> {  +            class TFHandle: public TOwned<TFileInput> {              public:                  TFHandle(int fd, size_t buffer_size) -                    : TOwned<TFileInput>(Duplicate(fd), buffer_size)  +                    : TOwned<TFileInput>(Duplicate(fd), buffer_size)                  {                  }              }; diff --git a/library/cpp/yson_pull/detail/lexer_base.h b/library/cpp/yson_pull/detail/lexer_base.h index 525304ec8ee..572bdb3d18b 100644 --- a/library/cpp/yson_pull/detail/lexer_base.h +++ b/library/cpp/yson_pull/detail/lexer_base.h @@ -19,7 +19,7 @@ namespace NYsonPull {              using Base = byte_reader<                  stream_counter<EnableLinePositionInfo>>; -            TVector<ui8> token_buffer_;  +            TVector<ui8> token_buffer_;              TMaybe<size_t> memory_limit_;          public: diff --git a/library/cpp/yson_pull/detail/output/stream.h b/library/cpp/yson_pull/detail/output/stream.h index 4c5ca4db827..d4810f33538 100644 --- a/library/cpp/yson_pull/detail/output/stream.h +++ b/library/cpp/yson_pull/detail/output/stream.h @@ -44,10 +44,10 @@ namespace NYsonPull {                  }              }; -            class TFHandle: public TOwned<TUnbufferedFileOutput> {  +            class TFHandle: public TOwned<TUnbufferedFileOutput> {              public:                  TFHandle(int fd, size_t buffer_size) -                    : TOwned<TUnbufferedFileOutput>(buffer_size, Duplicate(fd))  +                    : TOwned<TUnbufferedFileOutput>(buffer_size, Duplicate(fd))                  {                  }              }; diff --git a/library/cpp/yson_pull/detail/reader.h b/library/cpp/yson_pull/detail/reader.h index 655d450b8e7..0e023963581 100644 --- a/library/cpp/yson_pull/detail/reader.h +++ b/library/cpp/yson_pull/detail/reader.h @@ -188,7 +188,7 @@ namespace NYsonPull {              lexer_base<EnableLinePositionInfo> lexer_;              state state_;              TEvent event_; -            TVector<EEventType> stack_;  +            TVector<EEventType> stack_;              EStreamType mode_;          public: diff --git a/library/cpp/yson_pull/detail/writer.h b/library/cpp/yson_pull/detail/writer.h index 4b3238ec336..b24b9942927 100644 --- a/library/cpp/yson_pull/detail/writer.h +++ b/library/cpp/yson_pull/detail/writer.h @@ -32,7 +32,7 @@ namespace NYsonPull {              };              byte_writer<stream_counter<false>> stream_; -            TVector<EEventType> stack_;  +            TVector<EEventType> stack_;              bool need_item_separator_ = false;              EStreamType mode_ = EStreamType::ListFragment;              state state_ = state::before_begin; diff --git a/library/cpp/yson_pull/exceptions.h b/library/cpp/yson_pull/exceptions.h index 2d651990f89..ebfed950a54 100644 --- a/library/cpp/yson_pull/exceptions.h +++ b/library/cpp/yson_pull/exceptions.h @@ -2,7 +2,7 @@  #include "position_info.h" -#include <util/generic/string.h>  +#include <util/generic/string.h>  #include <stdexcept>  #include <string> @@ -10,13 +10,13 @@  namespace NYsonPull {      namespace NException {          class TBadStream: public std::exception { -            TString Message_;  +            TString Message_;              TPositionInfo Position_; -            mutable TString FormattedMessage_;  +            mutable TString FormattedMessage_;          public:              TBadStream( -                TString message,  +                TString message,                  const TPositionInfo& position)                  : Message_(std::move(message))                  , Position_(position) diff --git a/library/cpp/yson_pull/output.cpp b/library/cpp/yson_pull/output.cpp index 5b01023e378..27c9ef9e694 100644 --- a/library/cpp/yson_pull/output.cpp +++ b/library/cpp/yson_pull/output.cpp @@ -20,7 +20,7 @@ THolder<IStream> NOutput::FromPosixFd(int fd, size_t buffer_size) {      return MakeHolder<TFHandle>(fd, buffer_size);  } -THolder<IStream> NOutput::FromString(TString* output, size_t buffer_size) {  +THolder<IStream> NOutput::FromString(TString* output, size_t buffer_size) {      return MakeHolder<TOwned<TStringOutput>>(buffer_size, *output);  } diff --git a/library/cpp/yson_pull/output.h b/library/cpp/yson_pull/output.h index ba1c1bee319..2d78107a93f 100644 --- a/library/cpp/yson_pull/output.h +++ b/library/cpp/yson_pull/output.h @@ -60,6 +60,6 @@ namespace NYsonPull {          THolder<IStream> FromOutputStream(IOutputStream* output, size_t buffer_size = 65536); -        THolder<IStream> FromString(TString* output, size_t buffer_size = 1024);  +        THolder<IStream> FromString(TString* output, size_t buffer_size = 1024);      }  } diff --git a/library/cpp/yson_pull/read_ops.h b/library/cpp/yson_pull/read_ops.h index 125f6c9a579..5c084983ead 100644 --- a/library/cpp/yson_pull/read_ops.h +++ b/library/cpp/yson_pull/read_ops.h @@ -119,8 +119,8 @@ namespace NYsonPull {          }          template <> -        inline TString ReadScalar<TString>(TReader& reader) {  -            return TString(ReadScalar<TStringBuf>(reader));  +        inline TString ReadScalar<TString>(TReader& reader) { +            return TString(ReadScalar<TStringBuf>(reader));          }          template <> diff --git a/library/cpp/yson_pull/ut/cescape_ut.cpp b/library/cpp/yson_pull/ut/cescape_ut.cpp index d0f65be3fe1..6628ba1d156 100644 --- a/library/cpp/yson_pull/ut/cescape_ut.cpp +++ b/library/cpp/yson_pull/ut/cescape_ut.cpp @@ -5,7 +5,7 @@  using namespace NYsonPull::NDetail;  namespace { -    void test_roundtrip(const TVector<ui8>& str) {  +    void test_roundtrip(const TVector<ui8>& str) {          TStringBuf str_buf(              reinterpret_cast<const char*>(str.data()),              str.size()); @@ -19,7 +19,7 @@ namespace {      }      template <size_t N> -    void test_exhaustive(TVector<ui8>& str) {  +    void test_exhaustive(TVector<ui8>& str) {          for (int i = 0; i < 256; ++i) {              str[str.size() - N] = static_cast<char>(i);              test_exhaustive<N - 1>(str); @@ -27,13 +27,13 @@ namespace {      }      template <> -    void test_exhaustive<0>(TVector<ui8>& str) {  +    void test_exhaustive<0>(TVector<ui8>& str) {          test_roundtrip(str);      }      template <size_t N>      void test_exhaustive() { -        TVector<ui8> str(N, ' ');  +        TVector<ui8> str(N, ' ');          test_exhaustive<N>(str);      } diff --git a/library/cpp/yson_pull/ut/loop_ut.cpp b/library/cpp/yson_pull/ut/loop_ut.cpp index 361c3df8ca5..8c7b11dd1cd 100644 --- a/library/cpp/yson_pull/ut/loop_ut.cpp +++ b/library/cpp/yson_pull/ut/loop_ut.cpp @@ -215,7 +215,7 @@ namespace {      template <typename Function>      void test_memory(Function make_writer, size_t nrepeat) { -        TString text;  +        TString text;          {              auto writer = make_writer(NYsonPull::NOutput::FromString(&text));              generate(writer, nrepeat); diff --git a/library/cpp/yson_pull/ut/writer_ut.cpp b/library/cpp/yson_pull/ut/writer_ut.cpp index da204696978..5c304bad0f3 100644 --- a/library/cpp/yson_pull/ut/writer_ut.cpp +++ b/library/cpp/yson_pull/ut/writer_ut.cpp @@ -3,7 +3,7 @@  #include <library/cpp/testing/unittest/registar.h> -#include <util/generic/string.h>  +#include <util/generic/string.h>  #include <climits>  #include <limits> @@ -12,8 +12,8 @@ using namespace std::string_view_literals;  namespace {      template <typename Writer, typename Function> -    TString with_writer(Function&& function) {  -        TString result;  +    TString with_writer(Function&& function) { +        TString result;          auto writer = NYsonPull::NDetail::make_writer<Writer>(              NYsonPull::NOutput::FromString(&result),              NYsonPull::EStreamType::Node); @@ -24,19 +24,19 @@ namespace {      }      template <typename Writer> -    TString to_yson_string(const NYsonPull::TScalar& value) {  +    TString to_yson_string(const NYsonPull::TScalar& value) {          return with_writer<Writer>([&](NYsonPull::TWriter& writer) {              writer.BeginStream().Scalar(value).EndStream();          });      }      template <typename T> -    TString to_yson_binary_string(T&& value) {  +    TString to_yson_binary_string(T&& value) {          return to_yson_string<NYsonPull::NDetail::TBinaryWriterImpl>(std::forward<T>(value));      }      template <typename T> -    TString to_yson_text_string(T&& value) {  +    TString to_yson_text_string(T&& value) {          return to_yson_string<NYsonPull::NDetail::TTextWriterImpl>(std::forward<T>(value));      } | 
