Skip to content

Commit

Permalink
Remove #check_needs_resize from IO::Memory, String::Builder (#10732)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored May 23, 2021
1 parent 6efc206 commit bb5e532
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions spec/std/io/io_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ private class SimpleIOMemory < IO
self
end

private def check_needs_resize
resize_to_capacity(@capacity * 2) if @bytesize == @capacity
end

private def resize_to_capacity(capacity)
@capacity = capacity
@buffer = @buffer.realloc(@capacity)
Expand Down
4 changes: 0 additions & 4 deletions src/io/memory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,6 @@ class IO::Memory < IO
end
end

private def check_needs_resize
resize_to_capacity(@capacity * 2) if @bytesize == @capacity
end

private def resize_to_capacity(capacity)
@capacity = capacity
@buffer = @buffer.realloc(@capacity)
Expand Down
4 changes: 0 additions & 4 deletions src/string/builder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ class String::Builder < IO
@bytesize + String::HEADER_SIZE
end

private def check_needs_resize
resize_to_capacity(@capacity * 2) if real_bytesize == @capacity
end

private def resize_to_capacity(capacity)
@capacity = capacity
@buffer = @buffer.realloc(@capacity)
Expand Down

0 comments on commit bb5e532

Please sign in to comment.