Skip to content

Commit d83d842

Browse files
committed
🐎 Reserve string space before writing
1 parent 32376f6 commit d83d842

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/forest/forest.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ inline constexpr auto clear_v = literal<8>("<clear>");
344344

345345
inline std::string forest::format(std::string_view const text) {
346346
auto str = std::string{};
347+
str.reserve(length(text));
347348
format_to(std::back_inserter(str), text);
348349
return str;
349350
}

0 commit comments

Comments
 (0)