Skip to content

Commit a524391

Browse files
committed
update comment
1 parent 178aa39 commit a524391

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/small_string.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ size_t SmallString::Assign(std::string_view s) {
5959
DCHECK(CanAllocate(s.size()));
6060
uint8_t* realptr = nullptr;
6161

62-
// If the allocation is large enough and space efficient, we can avoid allocating
62+
// reallocate if we need a larger allocation or it becomes space-inefficient
63+
// TODO: check if mi_usable_size is has space before growing (like listpack)
6364
if (s.size() >= size_ || s.size() * 2 < MallocUsed()) {
6465
Free();
6566

0 commit comments

Comments
 (0)