diff options
author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/string/strip.cpp | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 2 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 b5e853cbb2e..c921571cf06 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(" ..."); + } +} |