Cleanup: remove unneeded checks on remaining buffer size

This commit is contained in:
Rubidium
2023-06-05 16:52:42 +02:00
committed by rubidium42
parent affceea0ae
commit edb21620ea
2 changed files with 3 additions and 18 deletions

View File

@@ -15,9 +15,6 @@
/**
* Equivalent to the std::back_insert_iterator in function, with some
* convenience helpers for string concatenation.
*
* The formatter is currently backed by an external char buffer, and has some
* extra functions to ease the migration from char buffers to std::string.
*/
class StringBuilder {
std::string *string;
@@ -80,11 +77,10 @@ public:
* Encode the given Utf8 character into the output buffer.
* @param c The character to encode.
*/
bool Utf8Encode(WChar c)
void Utf8Encode(WChar c)
{
auto iterator = std::back_inserter(*this->string);
::Utf8Encode(iterator, c);
return true;
}
/**
@@ -97,15 +93,6 @@ public:
this->string->erase(this->string->size() - std::min(amount, this->string->size()));
}
/**
* Get the remaining number of characters that can be placed.
* @return The number of characters.
*/
ptrdiff_t Remaining()
{
return 42; // Just something big-ish, as there's always space (until allocation fails)
}
/**
* Get the current index in the string.
* @return The index.