aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm12/lib/Support/FormatVariadic.cpp
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/Support/FormatVariadic.cpp
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/Support/FormatVariadic.cpp')
-rw-r--r--contrib/libs/llvm12/lib/Support/FormatVariadic.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/libs/llvm12/lib/Support/FormatVariadic.cpp b/contrib/libs/llvm12/lib/Support/FormatVariadic.cpp
index 06d423907a..f6d48bcd50 100644
--- a/contrib/libs/llvm12/lib/Support/FormatVariadic.cpp
+++ b/contrib/libs/llvm12/lib/Support/FormatVariadic.cpp
@@ -91,26 +91,26 @@ formatv_object_base::parseReplacementItem(StringRef Spec) {
std::pair<ReplacementItem, StringRef>
formatv_object_base::splitLiteralAndReplacement(StringRef Fmt) {
- while (!Fmt.empty()) {
+ while (!Fmt.empty()) {
// Everything up until the first brace is a literal.
- if (Fmt.front() != '{') {
- std::size_t BO = Fmt.find_first_of('{');
+ if (Fmt.front() != '{') {
+ std::size_t BO = Fmt.find_first_of('{');
return std::make_pair(ReplacementItem{Fmt.substr(0, BO)}, Fmt.substr(BO));
- }
+ }
- StringRef Braces = Fmt.take_while([](char C) { return C == '{'; });
+ StringRef Braces = Fmt.take_while([](char C) { return C == '{'; });
// If there is more than one brace, then some of them are escaped. Treat
// these as replacements.
if (Braces.size() > 1) {
size_t NumEscapedBraces = Braces.size() / 2;
- StringRef Middle = Fmt.take_front(NumEscapedBraces);
- StringRef Right = Fmt.drop_front(NumEscapedBraces * 2);
+ StringRef Middle = Fmt.take_front(NumEscapedBraces);
+ StringRef Right = Fmt.drop_front(NumEscapedBraces * 2);
return std::make_pair(ReplacementItem{Middle}, Right);
}
// An unterminated open brace is undefined. We treat the rest of the string
// as a literal replacement, but we assert to indicate that this is
// undefined and that we consider it an error.
- std::size_t BC = Fmt.find_first_of('}');
+ std::size_t BC = Fmt.find_first_of('}');
if (BC == StringRef::npos) {
assert(
false &&
@@ -121,12 +121,12 @@ formatv_object_base::splitLiteralAndReplacement(StringRef Fmt) {
// Even if there is a closing brace, if there is another open brace before
// this closing brace, treat this portion as literal, and try again with the
// next one.
- std::size_t BO2 = Fmt.find_first_of('{', 1);
+ std::size_t BO2 = Fmt.find_first_of('{', 1);
if (BO2 < BC)
return std::make_pair(ReplacementItem{Fmt.substr(0, BO2)},
Fmt.substr(BO2));
- StringRef Spec = Fmt.slice(1, BC);
+ StringRef Spec = Fmt.slice(1, BC);
StringRef Right = Fmt.substr(BC + 1);
auto RI = parseReplacementItem(Spec);
@@ -135,7 +135,7 @@ formatv_object_base::splitLiteralAndReplacement(StringRef Fmt) {
// If there was an error parsing the replacement item, treat it as an
// invalid replacement spec, and just continue.
- Fmt = Fmt.drop_front(BC + 1);
+ Fmt = Fmt.drop_front(BC + 1);
}
return std::make_pair(ReplacementItem{Fmt}, StringRef());
}