diff options
author | swarmer <swarmer@yandex-team.com> | 2024-08-07 00:19:42 +0300 |
---|---|---|
committer | swarmer <swarmer@yandex-team.com> | 2024-08-07 00:37:37 +0300 |
commit | a9c8987363503f0d434be8b1e7b494be65a2b477 (patch) | |
tree | 2338479c494ab77779f71c5fcb0e6810b3dcc52c /util | |
parent | cdaa807d2e96e0b0b8560eddf04d8f31a607c9ff (diff) | |
download | ydb-a9c8987363503f0d434be8b1e7b494be65a2b477.tar.gz |
check the lifetime of various algorithms that return a substring of the input TStringBuf view
e778480cb05d20fe1a3fbf5ff69858c8912ed2d6
Diffstat (limited to 'util')
-rw-r--r-- | util/charset/utf8.cpp | 2 | ||||
-rw-r--r-- | util/charset/utf8.h | 2 | ||||
-rw-r--r-- | util/folder/pathsplit.cpp | 2 | ||||
-rw-r--r-- | util/folder/pathsplit.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/util/charset/utf8.cpp b/util/charset/utf8.cpp index efe3a52f61..b1ccb00e21 100644 --- a/util/charset/utf8.cpp +++ b/util/charset/utf8.cpp @@ -99,7 +99,7 @@ static const char* SkipUTF8Chars(const char* begin, const char* end, size_t numC return begin; } -TStringBuf SubstrUTF8(const TStringBuf str, size_t pos, size_t len) { +TStringBuf SubstrUTF8(const TStringBuf str Y_LIFETIME_BOUND, size_t pos, size_t len) { const char* start = SkipUTF8Chars(str.begin(), str.end(), pos); const char* end = SkipUTF8Chars(start, str.end(), len); return TStringBuf(start, end - start); diff --git a/util/charset/utf8.h b/util/charset/utf8.h index 76c1f94078..d0c45e9d06 100644 --- a/util/charset/utf8.h +++ b/util/charset/utf8.h @@ -388,7 +388,7 @@ inline void WriteUTF8Char(wchar32 rune, size_t& rune_len, unsigned char* s) { } } -TStringBuf SubstrUTF8(const TStringBuf str, size_t pos, size_t len); +TStringBuf SubstrUTF8(const TStringBuf str Y_LIFETIME_BOUND, size_t pos, size_t len); enum EUTF8Detect { NotUTF8, diff --git a/util/folder/pathsplit.cpp b/util/folder/pathsplit.cpp index 816f696024..fd002b143a 100644 --- a/util/folder/pathsplit.cpp +++ b/util/folder/pathsplit.cpp @@ -132,7 +132,7 @@ TString JoinPaths(const TPathSplit& p1, const TPathSplit& p2) { return TPathSplit(p1).AppendMany(p2.begin(), p2.end()).Reconstruct(); } -TStringBuf CutExtension(const TStringBuf fileName) { +TStringBuf CutExtension(const TStringBuf fileName Y_LIFETIME_BOUND) { if (fileName.empty()) { return fileName; } diff --git a/util/folder/pathsplit.h b/util/folder/pathsplit.h index d134338e35..135457dbd0 100644 --- a/util/folder/pathsplit.h +++ b/util/folder/pathsplit.h @@ -110,4 +110,4 @@ using TPathSplitWindows = TPathSplitBase<TPathSplitTraitsWindows>; TString JoinPaths(const TPathSplit& p1, const TPathSplit& p2); -TStringBuf CutExtension(const TStringBuf fileName); +TStringBuf CutExtension(const TStringBuf fileName Y_LIFETIME_BOUND); |