Skip to content

Commit b1aff1a

Browse files
Don't over-allocate
1 parent b8a7928 commit b1aff1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/hyper_ruby/src/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait FillBuffer {
3030
let existing_capacity = rb_str_capacity(inner) as i64;
3131

3232
if existing_capacity < body_len {
33-
rb_str_modify_expand(inner, body_len);
33+
rb_str_modify_expand(inner, body_len - existing_capacity);
3434
} else {
3535
rb_str_modify(inner);
3636
}

0 commit comments

Comments
 (0)