aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/util.cpp
diff options
context:
space:
mode:
authorsobols <sobols@yandex-team.ru>2022-02-10 16:47:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:08 +0300
commit03335cb18337a0ef51966452a66a69b01abea218 (patch)
treeb83306b6e37edeea782e9eed673d89286c4fef35 /library/cpp/protobuf/json/util.cpp
parent09961b69c61f471ddd594e0fd877df62a8021562 (diff)
downloadydb-03335cb18337a0ef51966452a66a69b01abea218.tar.gz
Restoring authorship annotation for <sobols@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/util.cpp')
-rw-r--r--library/cpp/protobuf/json/util.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/protobuf/json/util.cpp b/library/cpp/protobuf/json/util.cpp
index c0c90c0e5c..53a065eee2 100644
--- a/library/cpp/protobuf/json/util.cpp
+++ b/library/cpp/protobuf/json/util.cpp
@@ -39,7 +39,7 @@ namespace {
}
}
}
-
+
namespace NProtobufJson {
void ToSnakeCase(TString* const name) {
ToSnakeCaseImpl(name, [](const char prev) { return prev != '_'; });
@@ -49,28 +49,28 @@ namespace NProtobufJson {
ToSnakeCaseImpl(name, [](const char prev) { return prev != '_' && !IsAsciiUpper(prev); });
}
- bool EqualsIgnoringCaseAndUnderscores(TStringBuf s1, TStringBuf s2) {
- size_t i1 = 0, i2 = 0;
-
- while (i1 < s1.size() && i2 < s2.size()) {
- if (s1[i1] == '_') {
- ++i1;
- } else if (s2[i2] == '_') {
- ++i2;
- } else if (AsciiToUpper(s1[i1]) != AsciiToUpper(s2[i2])) {
- return false;
- } else {
- ++i1, ++i2;
- }
- }
-
- while (i1 < s1.size() && s1[i1] == '_') {
- ++i1;
- }
- while (i2 < s2.size() && s2[i2] == '_') {
- ++i2;
- }
-
- return (i1 == s1.size() && i2 == s2.size());
- }
+ bool EqualsIgnoringCaseAndUnderscores(TStringBuf s1, TStringBuf s2) {
+ size_t i1 = 0, i2 = 0;
+
+ while (i1 < s1.size() && i2 < s2.size()) {
+ if (s1[i1] == '_') {
+ ++i1;
+ } else if (s2[i2] == '_') {
+ ++i2;
+ } else if (AsciiToUpper(s1[i1]) != AsciiToUpper(s2[i2])) {
+ return false;
+ } else {
+ ++i1, ++i2;
+ }
+ }
+
+ while (i1 < s1.size() && s1[i1] == '_') {
+ ++i1;
+ }
+ while (i2 < s2.size() && s2[i2] == '_') {
+ ++i2;
+ }
+
+ return (i1 == s1.size() && i2 == s2.size());
+ }
}