Skip to content

Commit

Permalink
Removed unnecessary field.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbordet committed Aug 20, 2015
1 parent 837a36e commit 9b6ba24
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions jetty-io/src/main/java/org/eclipse/jetty/io/ChannelEndPoint.java
Expand Up @@ -23,7 +23,6 @@
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.channels.GatheringByteChannel;
import java.nio.channels.SocketChannel;

import org.eclipse.jetty.util.BufferUtil;
Expand All @@ -39,9 +38,8 @@ public class ChannelEndPoint extends AbstractEndPoint
{
private static final Logger LOG = Log.getLogger(ChannelEndPoint.class);

private final ByteChannel _channel;
private final SocketChannel _channel;
private final Socket _socket;
private final GatheringByteChannel _gathering;
private volatile boolean _ishut;
private volatile boolean _oshut;

Expand All @@ -50,17 +48,16 @@ public ChannelEndPoint(Scheduler scheduler,SocketChannel channel)
super(scheduler,
(InetSocketAddress)channel.socket().getLocalSocketAddress(),
(InetSocketAddress)channel.socket().getRemoteSocketAddress());
_channel = channel;
_channel=channel;
_socket=channel.socket();
_gathering=_channel instanceof GatheringByteChannel?((GatheringByteChannel)_channel):null;
}

@Override
public boolean isOptimizedForDirectBuffers()
{
return true;
}

@Override
public boolean isOpen()
{
Expand Down Expand Up @@ -171,13 +168,13 @@ else if (filled==-1)
@Override
public boolean flush(ByteBuffer... buffers) throws IOException
{
int flushed=0;
long flushed=0;
try
{
if (buffers.length==1)
flushed=_channel.write(buffers[0]);
else if (_gathering!=null && buffers.length>1)
flushed= (int)_gathering.write(buffers,0,buffers.length);
else if (buffers.length>1)
flushed=_channel.write(buffers,0,buffers.length);
else
{
for (ByteBuffer b : buffers)
Expand Down

0 comments on commit 9b6ba24

Please sign in to comment.