diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:18 +0300 |
commit | 475c0a46f28166e83fd263badc7546377cddcabe (patch) | |
tree | 39c5a49b8aaad78fe390b6f1f2886bdbda40f3e7 /util/string/strip.cpp | |
parent | a6e0145a095c7bb3770d6e07aee301de5c73f96e (diff) | |
download | ydb-475c0a46f28166e83fd263badc7546377cddcabe.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/strip.cpp')
-rw-r--r-- | util/string/strip.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/string/strip.cpp b/util/string/strip.cpp index c921571cf0..0b942ca06f 100644 --- a/util/string/strip.cpp +++ b/util/string/strip.cpp @@ -1,23 +1,23 @@ #include "strip.h" #include "ascii.h" -#include <util/string/reverse.h> - +#include <util/string/reverse.h> + bool Collapse(const TString& from, TString& to, size_t maxLen) { return CollapseImpl<TString, bool (*)(unsigned char)>(from, to, maxLen, IsAsciiSpace); } void CollapseText(const TString& from, TString& to, size_t maxLen) { Collapse(from, to, maxLen); - StripInPlace(to); + StripInPlace(to); if (to.size() >= maxLen) { to.remove(maxLen - 5); // " ..." - ReverseInPlace(to); + ReverseInPlace(to); size_t pos = to.find_first_of(" .,;"); if (pos != TString::npos && pos < 32) { to.remove(0, pos + 1); } - ReverseInPlace(to); + ReverseInPlace(to); to.append(" ..."); } } |