diff options
author | savrus <savrus@yandex-team.com> | 2022-09-19 22:36:24 +0300 |
---|---|---|
committer | savrus <savrus@yandex-team.com> | 2022-09-19 22:36:24 +0300 |
commit | c62e39eff60f637bfe4eeae1984034d010cc3e80 (patch) | |
tree | 03495974687e9d403be629256547f347665f06ff /library/cpp/yt/yson_string | |
parent | aecd1bb1e7a5e9fe53d3828747a6cbc36f9f4e41 (diff) | |
download | ydb-c62e39eff60f637bfe4eeae1984034d010cc3e80.tar.gz |
Introduce shared range holders
Diffstat (limited to 'library/cpp/yt/yson_string')
-rw-r--r-- | library/cpp/yt/yson_string/string.cpp | 6 | ||||
-rw-r--r-- | library/cpp/yt/yson_string/string.h | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/library/cpp/yt/yson_string/string.cpp b/library/cpp/yt/yson_string/string.cpp index 15eafdf615..87aa08cce4 100644 --- a/library/cpp/yt/yson_string/string.cpp +++ b/library/cpp/yt/yson_string/string.cpp @@ -72,7 +72,7 @@ TYsonString::TYsonString(const TYsonStringBuf& ysonStringBuf) { if (ysonStringBuf) { struct TCapturedYsonStringPayload - : public TRefCounted + : public ISharedRangeHolder , public TWithExtraSpace<TCapturedYsonStringPayload> { char* GetData() @@ -155,7 +155,7 @@ TString TYsonString::ToString() const [] (const TNullPayload&) -> TString { YT_ABORT(); }, - [&] (const THolder&) { + [&] (const ISharedRangeHolderPtr&) { return TString(AsStringBuf()); }, [] (const TString& payload) { @@ -170,7 +170,7 @@ TSharedRef TYsonString::ToSharedRef() const [] (const TNullPayload&) -> TSharedRef { YT_ABORT(); }, - [&] (const THolder& holder) { + [&] (const ISharedRangeHolderPtr& holder) { return TSharedRef(Begin_, Size_, holder); }, [] (const TString& payload) { diff --git a/library/cpp/yt/yson_string/string.h b/library/cpp/yt/yson_string/string.h index 8feb01806d..413851acf4 100644 --- a/library/cpp/yt/yson_string/string.h +++ b/library/cpp/yt/yson_string/string.h @@ -111,9 +111,7 @@ private: struct TNullPayload { }; - using THolder = TRefCountedPtr; - - std::variant<TNullPayload, THolder, TString> Payload_; + std::variant<TNullPayload, ISharedRangeHolderPtr, TString> Payload_; const char* Begin_; ui64 Size_ : 56; |