aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/cast.cpp
diff options
context:
space:
mode:
authorakhropov <akhropov@yandex-team.ru>2022-02-10 16:46:32 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:32 +0300
commit298c6da79f1d8f35089a67f463f0b541bec36d9b (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/string/cast.cpp
parent00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (diff)
downloadydb-298c6da79f1d8f35089a67f463f0b541bec36d9b.tar.gz
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/cast.cpp')
-rw-r--r--util/string/cast.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/util/string/cast.cpp b/util/string/cast.cpp
index 75741efe21..aa1e65a8e9 100644
--- a/util/string/cast.cpp
+++ b/util/string/cast.cpp
@@ -54,7 +54,7 @@ namespace {
template <class T>
std::enable_if_t<std::is_signed<T>::value, std::make_unsigned_t<T>> NegateNegativeSigned(T value) noexcept {
return std::make_unsigned_t<T>(-(value + 1)) + std::make_unsigned_t<T>(1);
- }
+ }
template <class T>
std::enable_if_t<std::is_unsigned<T>::value, std::make_unsigned_t<T>> NegateNegativeSigned(T) noexcept {
@@ -482,29 +482,29 @@ size_t ToStringImpl<bool>(bool t, char* buf, size_t len) {
/*
* ------------------------------ parsers ------------------------------
*/
-
-template <>
+
+template <>
bool TryFromStringImpl<bool>(const char* data, size_t len, bool& result) {
- if (len == 1) {
- if (data[0] == '0') {
+ if (len == 1) {
+ if (data[0] == '0') {
result = false;
return true;
- } else if (data[0] == '1') {
+ } else if (data[0] == '1') {
result = true;
- return true;
- }
- }
- TStringBuf buf(data, len);
+ return true;
+ }
+ }
+ TStringBuf buf(data, len);
if (IsTrue(buf)) {
result = true;
- return true;
+ return true;
} else if (IsFalse(buf)) {
result = false;
return true;
- }
+ }
return false;
-}
-
+}
+
template <>
bool FromStringImpl<bool>(const char* data, size_t len) {
bool result;