From 6d2b9a96296936d2ec7af66a85201a549b995980 Mon Sep 17 00:00:00 2001 From: dgolear Date: Thu, 17 Oct 2024 18:38:56 +0300 Subject: [PATCH] YTORM-1187: Fix IN and BETWEEN expression work with indexes commit_hash:12d86de033f73ea238ebde7f47b689d30014119a --- library/cpp/yt/string/string-inl.h | 32 +++++++++++++++--------------- library/cpp/yt/string/string.h | 28 ++++++++++++-------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/library/cpp/yt/string/string-inl.h b/library/cpp/yt/string/string-inl.h index baf789b4f..e3bf094aa 100644 --- a/library/cpp/yt/string/string-inl.h +++ b/library/cpp/yt/string/string-inl.h @@ -4,7 +4,7 @@ #include "string.h" #endif -#include "format.h" +#include "string_builder.h" namespace NYT { @@ -19,7 +19,7 @@ namespace NYT { * \param delimiter A delimiter to be inserted between items: ", " by default. * \return The resulting combined string. */ -template +template void JoinToString( TStringBuilderBase* builder, const TIterator& begin, @@ -35,7 +35,7 @@ void JoinToString( } } -template +template TString JoinToString( const TIterator& begin, const TIterator& end, @@ -48,7 +48,7 @@ TString JoinToString( } //! A handy shortcut with default formatter. -template +template TString JoinToString( const TIterator& begin, const TIterator& end, @@ -63,9 +63,9 @@ TString JoinToString( * \param formatter Formatter to apply to the items. * \param delimiter A delimiter to be inserted between items; ", " by default. */ -template +template TString JoinToString( - const TCollection& collection, + TCollection&& collection, const TFormatter& formatter, TStringBuf delimiter) { @@ -75,12 +75,12 @@ TString JoinToString( } //! A handy shortcut with the default formatter. -template +template TString JoinToString( - const TCollection& collection, + TCollection&& collection, TStringBuf delimiter) { - return JoinToString(collection, TDefaultFormatter(), delimiter); + return JoinToString(std::forward(collection), TDefaultFormatter(), delimiter); } //! Concatenates a bunch of TStringBuf-like instances into TString. @@ -98,7 +98,7 @@ TString ConcatToString(Ts... args) } //! Converts a range of items into strings. -template +template std::vector ConvertToStrings( const TIter& begin, const TIter& end, @@ -118,7 +118,7 @@ std::vector ConvertToStrings( } //! A handy shortcut with the default formatter. -template +template std::vector ConvertToStrings( const TIter& begin, const TIter& end, @@ -133,9 +133,9 @@ std::vector ConvertToStrings( * \param formatter Formatter to apply to the items. * \param maxSize Size limit for the resulting vector. */ -template +template std::vector ConvertToStrings( - const TCollection& collection, + TCollection&& collection, const TFormatter& formatter, size_t maxSize) { @@ -145,12 +145,12 @@ std::vector ConvertToStrings( } //! A handy shortcut with default formatter. -template +template std::vector ConvertToStrings( - const TCollection& collection, + TCollection&& collection, size_t maxSize) { - return ConvertToStrings(collection, TDefaultFormatter(), maxSize); + return ConvertToStrings(std::forward(collection), TDefaultFormatter(), maxSize); } //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/yt/string/string.h b/library/cpp/yt/string/string.h index b91d1b380..9794cfd69 100644 --- a/library/cpp/yt/string/string.h +++ b/library/cpp/yt/string/string.h @@ -9,8 +9,6 @@ #include #include -#include -#include namespace NYT { @@ -65,7 +63,7 @@ static constexpr TStringBuf IntToHexUppercase = "0123456789ABCDEF"; * \param delimiter A delimiter to be inserted between items: ", " by default. * \return The resulting combined string. */ -template +template void JoinToString( TStringBuilderBase* builder, const TIterator& begin, @@ -73,7 +71,7 @@ void JoinToString( const TFormatter& formatter, TStringBuf delimiter = DefaultJoinToStringDelimiter); -template +template TString JoinToString( const TIterator& begin, const TIterator& end, @@ -81,7 +79,7 @@ TString JoinToString( TStringBuf delimiter = DefaultJoinToStringDelimiter); //! A handy shortcut with default formatter. -template +template TString JoinToString( const TIterator& begin, const TIterator& end, @@ -93,16 +91,16 @@ TString JoinToString( * \param formatter Formatter to apply to the items. * \param delimiter A delimiter to be inserted between items; ", " by default. */ -template +template TString JoinToString( - const TCollection& collection, + TCollection&& collection, const TFormatter& formatter, TStringBuf delimiter = DefaultJoinToStringDelimiter); //! A handy shortcut with the default formatter. -template +template TString JoinToString( - const TCollection& collection, + TCollection&& collection, TStringBuf delimiter = DefaultJoinToStringDelimiter); //! Concatenates a bunch of TStringBuf-like instances into TString. @@ -110,7 +108,7 @@ template TString ConcatToString(Ts... args); //! Converts a range of items into strings. -template +template std::vector ConvertToStrings( const TIter& begin, const TIter& end, @@ -118,7 +116,7 @@ std::vector ConvertToStrings( size_t maxSize = std::numeric_limits::max()); //! A handy shortcut with the default formatter. -template +template std::vector ConvertToStrings( const TIter& begin, const TIter& end, @@ -130,16 +128,16 @@ std::vector ConvertToStrings( * \param formatter Formatter to apply to the items. * \param maxSize Size limit for the resulting vector. */ -template +template std::vector ConvertToStrings( - const TCollection& collection, + TCollection&& collection, const TFormatter& formatter, size_t maxSize = std::numeric_limits::max()); //! A handy shortcut with default formatter. -template +template std::vector ConvertToStrings( - const TCollection& collection, + TCollection&& collection, size_t maxSize = std::numeric_limits::max()); ////////////////////////////////////////////////////////////////////////////////