diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/string/strip.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/strip.cpp')
-rw-r--r-- | util/string/strip.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/util/string/strip.cpp b/util/string/strip.cpp index c921571cf0..b5e853cbb2 100644 --- a/util/string/strip.cpp +++ b/util/string/strip.cpp @@ -1,23 +1,23 @@ -#include "strip.h" -#include "ascii.h" - +#include "strip.h" +#include "ascii.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); if (to.size() >= maxLen) { to.remove(maxLen - 5); // " ..." ReverseInPlace(to); - size_t pos = to.find_first_of(" .,;"); - if (pos != TString::npos && pos < 32) { - to.remove(0, pos + 1); - } + size_t pos = to.find_first_of(" .,;"); + if (pos != TString::npos && pos < 32) { + to.remove(0, pos + 1); + } ReverseInPlace(to); - to.append(" ..."); - } -} + to.append(" ..."); + } +} |