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
pull/1305/head
Phoebe Liang 2 years ago committed by Copybara-Service
parent 1b6a9e95a7
commit 8279400382
  1. 2
      absl/strings/internal/stringify_sink.h
  2. 24
      absl/strings/str_cat.cc

@ -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);

@ -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) {

Loading…
Cancel
Save