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
commit09961b69c61f471ddd594e0fd877df62a8021562 (patch)
tree54a7b60a9526a7104557a033eb0a8d70d64b604c /library/cpp/protobuf/json/util.cpp
parent4ce8835206f981afa4a61915a49a21fb750416ec (diff)
downloadydb-09961b69c61f471ddd594e0fd877df62a8021562.tar.gz
Restoring authorship annotation for <sobols@yandex-team.ru>. Commit 1 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 53a065eee2..c0c90c0e5c 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());
+ }
}