mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
This commit is contained in:
parent
beda478821
commit
9624b54703
48 changed files with 234 additions and 250 deletions
|
@ -5,13 +5,13 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
inline void StringBuilder::will_append(size_t size)
|
||||
inline void StringBuilder::will_append(ssize_t size)
|
||||
{
|
||||
if ((m_length + size) > m_buffer.size())
|
||||
m_buffer.grow(max((size_t)16, m_buffer.size() * 2 + size));
|
||||
m_buffer.grow(max((ssize_t)16, m_buffer.size() * 2 + size));
|
||||
}
|
||||
|
||||
StringBuilder::StringBuilder(size_t initial_capacity)
|
||||
StringBuilder::StringBuilder(ssize_t initial_capacity)
|
||||
{
|
||||
m_buffer.grow(initial_capacity);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ void StringBuilder::append(const String& str)
|
|||
m_length += str.length();
|
||||
}
|
||||
|
||||
void StringBuilder::append(const char* characters, size_t length)
|
||||
void StringBuilder::append(const char* characters, ssize_t length)
|
||||
{
|
||||
if (!length)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue