added overloaded method to the DefaultChannelPipeline in order to avoid unnecessary allocation
Motivation : Avoid unnecessary array allocation when using the function with varargs in the DefaultChannelPipeline class. Modifications : Added addLast and addFirst overloaded methods with 1 handler instead of varargs. Result : No array allocation when using simple construction like pipeline.addLast(new Handler());
This commit is contained in:
parent
55ef09f191
commit
f9888acfdd
@ -354,6 +354,10 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
ctx.next = newCtx;
|
||||
}
|
||||
|
||||
public final ChannelPipeline addFirst(ChannelHandler handler) {
|
||||
return addFirst(null, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ChannelPipeline addFirst(ChannelHandler... handlers) {
|
||||
return addFirst(null, handlers);
|
||||
@ -383,6 +387,10 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
return this;
|
||||
}
|
||||
|
||||
public final ChannelPipeline addLast(ChannelHandler handler) {
|
||||
return addLast(null, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ChannelPipeline addLast(ChannelHandler... handlers) {
|
||||
return addLast(null, handlers);
|
||||
|
Loading…
Reference in New Issue
Block a user