From 030ece5bf9b9fede389a0ecc39253d97bef4347d Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 27 Jan 2010 02:43:49 +0000 Subject: [PATCH] Removed redundant conditional --- .../org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java | 2 +- src/main/java/org/jboss/netty/buffer/ChannelBuffers.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java b/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java index caadaddcbb..1a4bc5678f 100644 --- a/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java +++ b/src/main/java/org/jboss/netty/buffer/ByteBufferBackedChannelBuffer.java @@ -225,7 +225,7 @@ public class ByteBufferBackedChannelBuffer extends AbstractChannelBuffer { int readBytes = 0; - if (!buffer.isReadOnly() && buffer.hasArray()) { + if (buffer.hasArray()) { index += buffer.arrayOffset(); do { int localReadBytes = in.read(buffer.array(), index, length); diff --git a/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java b/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java index cc4b3e924e..a5c535080a 100644 --- a/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java +++ b/src/main/java/org/jboss/netty/buffer/ChannelBuffers.java @@ -301,7 +301,7 @@ public class ChannelBuffers { if (!buffer.hasRemaining()) { return EMPTY_BUFFER; } - if (!buffer.isReadOnly() && buffer.hasArray()) { + if (buffer.hasArray()) { return wrappedBuffer(buffer.order(), buffer.array(), buffer.arrayOffset(),buffer.remaining()); } else { return new ByteBufferBackedChannelBuffer(buffer);