summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Phoebe Liang <phoebeliang@google.com>2022-10-27 13:44:52 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-10-27 13:45:48 -0700
commit827940038258b35a29279d8c65b4b4ca0a676f8d (patch)
treee480c657a9999fee9b88317f3ad2afae0131f134
parent1b6a9e95a704ff947438ae8b829072c78a0f0fdc (diff)
Removes `PutPaddedString()` function
This function is unnecessary as it was originally used to support modifiers with `absl::StrFormat()`. This functionality is irrelevant to `absl::StrCat()`. PiperOrigin-RevId: 484339246 Change-Id: I8c4a0ee01b30aee7a83f6ab54e5465465cc9cc56
-rw-r--r--absl/strings/internal/stringify_sink.h2
-rw-r--r--absl/strings/str_cat.cc24
2 files changed, 0 insertions, 26 deletions
diff --git a/absl/strings/internal/stringify_sink.h b/absl/strings/internal/stringify_sink.h
index a83f70e4..5e326a0b 100644
--- a/absl/strings/internal/stringify_sink.h
+++ b/absl/strings/internal/stringify_sink.h
@@ -31,8 +31,6 @@ class StringifySink {
void Append(string_view v);
- bool PutPaddedString(string_view v, int width, int precision, bool left);
-
// Support `absl::Format(&sink, format, args...)`.
friend void AbslFormatFlush(StringifySink* sink, absl::string_view v) {
sink->Append(v);
diff --git a/absl/strings/str_cat.cc b/absl/strings/str_cat.cc
index 6981347a..21819203 100644
--- a/absl/strings/str_cat.cc
+++ b/absl/strings/str_cat.cc
@@ -37,30 +37,6 @@ void StringifySink::Append(string_view v) {
buffer_.append(v.data(), v.size());
}
-bool StringifySink::PutPaddedString(string_view v, int width, int precision,
- bool left) {
- size_t space_remaining = 0;
-
- if (width >= 0) space_remaining = static_cast<size_t>(width);
-
- size_t n = v.size();
-
- if (precision >= 0) n = (std::min)(n, static_cast<size_t>(precision));
-
- string_view shown(v.data(), n);
-
- if (shown.size() < space_remaining) {
- space_remaining = space_remaining - shown.size();
- } else {
- space_remaining = 0;
- }
-
- if (!left) Append(space_remaining, ' ');
- Append(shown);
- if (left) Append(space_remaining, ' ');
- return true;
-}
-
} // namespace strings_internal
AlphaNum::AlphaNum(Hex hex) {