Reduced unnecessary duplicate calls on NioDatagramChannel

This commit is contained in:
Trustin Lee 2010-01-29 03:02:03 +00:00
parent 9b1d9b0c61
commit c4b5248f68

View File

@ -383,9 +383,9 @@ class NioDatagramWorker implements Runnable {
*/
private boolean read(final SelectionKey key) {
final NioDatagramChannel channel = (NioDatagramChannel) key.attachment();
ReceiveBufferSizePredictor predictor =
channel.getConfig().getReceiveBufferSizePredictor();
final ChannelBufferFactory bufferFactory = channel.getConfig().getBufferFactory();
final NioDatagramChannelConfig cfg = channel.getConfig();
final ReceiveBufferSizePredictor predictor = cfg.getReceiveBufferSizePredictor();
final ChannelBufferFactory bufferFactory = cfg.getBufferFactory();
final DatagramChannel nioChannel = (DatagramChannel) key.channel();
// Allocating a non-direct buffer with a max udp packge size.