Eliminate use of ByteBufWriteUtil from route-target 10/86710/2
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 5 Jan 2020 11:02:37 +0000 (12:02 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 5 Jan 2020 13:46:54 +0000 (14:46 +0100)
There is a single caller, which can trivially be updated to use
ByteBufUtils with improved efficiency.

Change-Id: I7f636cfc1d7ecb6922bd5e29026d4137783baeba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/extensions/route-target/src/main/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/nlri/RouteTargetConstrainNlriHandler.java

index f6e38e64c7f551e982b59ad65d6d2a49158a3d9f..b89e8df3df3853299cbb624f99afe7ccf153a27e 100644 (file)
@@ -5,11 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.protocol.bgp.route.targetcontrain.impl.nlri;
 
-import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedInt;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
@@ -85,7 +82,7 @@ public final class RouteTargetConstrainNlriHandler implements NlriParser, NlriSe
                 nlri.writeByte(RT_BITS_LENGTH);
                 final AsNumber originAs = dest.getOriginAs();
                 if (originAs != null) {
-                    writeUnsignedInt(originAs.getValue(), nlri);
+                    ByteBufUtils.write(nlri, originAs.getValue());
                 }
                 nlri.writeBytes(SimpleRouteTargetConstrainNlriRegistry.getInstance()
                         .serializeRouteTargetConstrain(rtcChoice));