aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/split.h
diff options
context:
space:
mode:
authorantonovvk <antonovvk@yandex-team.ru>2022-02-10 16:47:51 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:51 +0300
commit37a63debdc21e372d99e1808cdd31aecf75018c3 (patch)
treefd84293fb9a1b16381dd6c1a5e14c78afacb8710 /util/string/split.h
parent1fe621e70df847cc201ac942fe6d7804ea10508d (diff)
downloadydb-37a63debdc21e372d99e1808cdd31aecf75018c3.tar.gz
Restoring authorship annotation for <antonovvk@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/split.h')
-rw-r--r--util/string/split.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/util/string/split.h b/util/string/split.h
index bc46d9e64c..17149d1785 100644
--- a/util/string/split.h
+++ b/util/string/split.h
@@ -198,29 +198,29 @@ private:
template <class Char>
struct TFindFirstOf {
inline TFindFirstOf(Char* set)
- : Set(set)
- {
- }
-
+ : Set(set)
+ {
+ }
+
inline Char* FindFirstOf(Char* b, Char* e) const noexcept {
Char* ret = b;
- for (; ret != e; ++ret) {
+ for (; ret != e; ++ret) {
if (NStringSplitPrivate::Find(Set, *ret))
- break;
- }
- return ret;
- }
-
+ break;
+ }
+ return ret;
+ }
+
inline Char* FindFirstOf(Char* b) const noexcept {
const std::basic_string_view<Char> bView(b);
const auto ret = bView.find_first_of(Set);
return ret != std::string::npos ? b + ret : b + bView.size();
- }
-
+ }
+
Char* Set;
-};
-
-template <>
+};
+
+template <>
struct TFindFirstOf<const char>: public TCompactStrSpn {
inline TFindFirstOf(const char* set, const char* e)
: TCompactStrSpn(set, e)
@@ -229,37 +229,37 @@ struct TFindFirstOf<const char>: public TCompactStrSpn {
inline TFindFirstOf(const char* set)
: TCompactStrSpn(set)
- {
- }
+ {
+ }
};
-
+
template <class Char>
struct TSetDelimiter: private TFindFirstOf<const Char> {
using TFindFirstOf<const Char>::TFindFirstOf;
-
+
inline Char* Find(Char*& b, Char* e) const noexcept {
Char* ret = const_cast<Char*>(this->FindFirstOf(b, e));
- if (ret != e) {
- b = ret + 1;
- return ret;
- }
-
- return (b = e);
- }
-
+ if (ret != e) {
+ b = ret + 1;
+ return ret;
+ }
+
+ return (b = e);
+ }
+
inline Char* Find(Char*& b) const noexcept {
Char* ret = const_cast<Char*>(this->FindFirstOf(b));
-
- if (*ret) {
- b = ret + 1;
- return ret;
- }
-
- return (b = ret);
- }
-};
-
+
+ if (*ret) {
+ b = ret + 1;
+ return ret;
+ }
+
+ return (b = ret);
+ }
+};
+
namespace NSplitTargetHasPushBack {
Y_HAS_MEMBER(push_back, PushBack);
}