aboutsummaryrefslogtreecommitdiffstats
path: root/util/charset/wide.cpp
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/charset/wide.cpp
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/charset/wide.cpp')
-rw-r--r--util/charset/wide.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/util/charset/wide.cpp b/util/charset/wide.cpp
index 49badb7f14..a287438ddd 100644
--- a/util/charset/wide.cpp
+++ b/util/charset/wide.cpp
@@ -31,7 +31,7 @@ namespace {
}
}
-void Collapse(TUtf16String& w) {
+void Collapse(TUtf16String& w) {
CollapseImpl(w, w, 0, IsWhitespace);
}
@@ -532,20 +532,20 @@ static TUtf32String ToSmthRet(const TUtf32StringBuf text, size_t pos, size_t cou
}
TUtf16String ToLowerRet(const TWtringBuf text, size_t pos, size_t count) {
- return ToSmthRet(text, pos, count, [](const wchar16* theText, size_t length, wchar16* out) {
- ToLower(theText, length, out);
+ return ToSmthRet(text, pos, count, [](const wchar16* theText, size_t length, wchar16* out) {
+ ToLower(theText, length, out);
});
}
TUtf16String ToUpperRet(const TWtringBuf text, size_t pos, size_t count) {
- return ToSmthRet(text, pos, count, [](const wchar16* theText, size_t length, wchar16* out) {
- ToUpper(theText, length, out);
+ return ToSmthRet(text, pos, count, [](const wchar16* theText, size_t length, wchar16* out) {
+ ToUpper(theText, length, out);
});
}
TUtf16String ToTitleRet(const TWtringBuf text, size_t pos, size_t count) {
- return ToSmthRet(text, pos, count, [](const wchar16* theText, size_t length, wchar16* out) {
- ToTitle(theText, length, out);
+ return ToSmthRet(text, pos, count, [](const wchar16* theText, size_t length, wchar16* out) {
+ ToTitle(theText, length, out);
});
}
@@ -568,16 +568,16 @@ TUtf32String ToTitleRet(const TUtf32StringBuf text, size_t pos, size_t count) {
}
template <bool insertBr>
-void EscapeHtmlChars(TUtf16String& str) {
- static const TUtf16String lt(LT, Y_ARRAY_SIZE(LT));
- static const TUtf16String gt(GT, Y_ARRAY_SIZE(GT));
- static const TUtf16String amp(AMP, Y_ARRAY_SIZE(AMP));
- static const TUtf16String br(BR, Y_ARRAY_SIZE(BR));
- static const TUtf16String quot(QUOT, Y_ARRAY_SIZE(QUOT));
+void EscapeHtmlChars(TUtf16String& str) {
+ static const TUtf16String lt(LT, Y_ARRAY_SIZE(LT));
+ static const TUtf16String gt(GT, Y_ARRAY_SIZE(GT));
+ static const TUtf16String amp(AMP, Y_ARRAY_SIZE(AMP));
+ static const TUtf16String br(BR, Y_ARRAY_SIZE(BR));
+ static const TUtf16String quot(QUOT, Y_ARRAY_SIZE(QUOT));
size_t escapedLen = 0;
- const TUtf16String& cs = str;
+ const TUtf16String& cs = str;
for (size_t i = 0; i < cs.size(); ++i)
escapedLen += EscapedLen<insertBr>(cs[i]);
@@ -585,13 +585,13 @@ void EscapeHtmlChars(TUtf16String& str) {
if (escapedLen == cs.size())
return;
- TUtf16String res;
+ TUtf16String res;
res.reserve(escapedLen);
size_t start = 0;
for (size_t i = 0; i < cs.size(); ++i) {
- const TUtf16String* ent = nullptr;
+ const TUtf16String* ent = nullptr;
switch (cs[i]) {
case '<':
ent = &lt;
@@ -622,5 +622,5 @@ void EscapeHtmlChars(TUtf16String& str) {
res.swap(str);
}
-template void EscapeHtmlChars<false>(TUtf16String& str);
-template void EscapeHtmlChars<true>(TUtf16String& str);
+template void EscapeHtmlChars<false>(TUtf16String& str);
+template void EscapeHtmlChars<true>(TUtf16String& str);