MCPcopy Create free account
hub / github.com/catboost/catboost / StripRight

Function StripRight

util/charset/wide.cpp:62–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62TWtringBuf StripRight(const TWtringBuf text) noexcept {
63 if (!text) {
64 return {};
65 }
66
67 const auto* const pe = text.data() - 1;
68 const auto* p = text.data() + text.size() - 1;
69
70 for (; p != pe && IsWhitespace(*p); --p) {
71 }
72
73 return {pe + 1, p + 1};
74}
75
76void StripRight(TUtf16String& text) {
77 const auto stripped = StripRight(TWtringBuf(text));

Callers 2

TestStripMethod · 0.85
StripFunction · 0.85

Calls 4

IsWhitespaceFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 1

TestStripMethod · 0.68