Skip to content

Commit

Permalink
lib/flow: call memcmp in miniflow_equal()
Browse files Browse the repository at this point in the history
This commit replace a while loop in miniflow_equal() with a call to
memcmp() for performace reasons.

Signed-off-by: Daniele Di Proietto <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
ddiproietto authored and blp committed May 27, 2014
1 parent 7f1e1c7 commit 8cc8680
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,11 +1748,7 @@ miniflow_equal(const struct miniflow *a, const struct miniflow *b)
if (OVS_LIKELY(a_map == b_map)) {
int count = miniflow_n_values(a);

while (count--) {
if (*ap++ != *bp++) {
return false;
}
}
return !memcmp(ap, bp, count * sizeof *ap);
} else {
uint64_t map;

Expand Down

0 comments on commit 8cc8680

Please sign in to comment.