aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/yson_string
diff options
context:
space:
mode:
authorsavrus <savrus@yandex-team.com>2022-09-19 22:36:24 +0300
committersavrus <savrus@yandex-team.com>2022-09-19 22:36:24 +0300
commitc62e39eff60f637bfe4eeae1984034d010cc3e80 (patch)
tree03495974687e9d403be629256547f347665f06ff /library/cpp/yt/yson_string
parentaecd1bb1e7a5e9fe53d3828747a6cbc36f9f4e41 (diff)
downloadydb-c62e39eff60f637bfe4eeae1984034d010cc3e80.tar.gz
Introduce shared range holders
Diffstat (limited to 'library/cpp/yt/yson_string')
-rw-r--r--library/cpp/yt/yson_string/string.cpp6
-rw-r--r--library/cpp/yt/yson_string/string.h4
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;