Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
*/
class NettyWritableBufferAllocator implements WritableBufferAllocator {

// Use 4k as our minimum buffer size.
private static final int MIN_BUFFER = 4 * 1024;

// Set the maximum buffer size to 1MB.
private static final int MAX_BUFFER = 1024 * 1024;

Expand All @@ -47,7 +44,7 @@ class NettyWritableBufferAllocator implements WritableBufferAllocator {

@Override
public WritableBuffer allocate(int capacityHint) {
capacityHint = Math.min(MAX_BUFFER, Math.max(MIN_BUFFER, capacityHint));
capacityHint = Math.min(MAX_BUFFER, capacityHint);
return new NettyWritableBuffer(allocator.buffer(capacityHint, capacityHint));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ protected WritableBufferAllocator allocator() {
return allocator;
}

@Test
public void testCapacityHasMinimum() {
WritableBuffer buffer = allocator().allocate(100);
assertEquals(0, buffer.readableBytes());
assertEquals(4096, buffer.writableBytes());
}

@Test
public void testCapacityIsExactAboveMinimum() {
WritableBuffer buffer = allocator().allocate(9000);
Expand Down