Skip to content

Commit 42b368e

Browse files
Force BackBuffer erase to shrink_to_fit
1 parent f4207c0 commit 42b368e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AsyncSocketData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct BackPressure {
3737
pendingRemoval += length;
3838
/* Always erase a minimum of 1/32th the current backpressure */
3939
if (pendingRemoval > (buffer.length() >> 5)) {
40-
buffer.erase(0, pendingRemoval);
40+
std::string(buffer.begin() + pendingRemoval, buffer.end()).swap(buffer);
4141
pendingRemoval = 0;
4242
}
4343
}

0 commit comments

Comments
 (0)