Skip to content

Commit

Permalink
MacAddress.putTo - performance optimization LOXI-77
Browse files Browse the repository at this point in the history
It is correct to directly digest the long value instead of doing big-mangling
and digesting an int and a short.
  • Loading branch information
andi-bigswitch committed May 19, 2016
1 parent 442b8b8 commit fd6c3f5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.projectfloodlight.openflow.types;

import java.util.Arrays;

import javax.annotation.Nonnull;

import org.projectfloodlight.openflow.exceptions.OFParseError;
Expand Down Expand Up @@ -232,8 +233,7 @@ public int compareTo(MacAddress o) {

@Override
public void putTo(PrimitiveSink sink) {
sink.putInt((int) (this.rawValue >> 16));
sink.putShort((short) (this.rawValue & 0xFFFF));
sink.putLong(rawValue);
}

/*
Expand Down

0 comments on commit fd6c3f5

Please sign in to comment.