summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AK/String.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/String.cpp b/AK/String.cpp
index 79d849496f..44fd77fb70 100644
--- a/AK/String.cpp
+++ b/AK/String.cpp
@@ -358,7 +358,7 @@ size_t String::count(const String& needle) const
String String::reverse() const
{
- StringBuilder reversed_string;
+ StringBuilder reversed_string(length());
for (size_t i = length(); i-- > 0;) {
reversed_string.append(characters()[i]);
}