2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

lib: Use MAP_FOR_EACH_INDEX to improve readability.

Use MAP_FOR_EACH_INDEX to improve readability when there is no
apparent cost for it.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2014-11-26 15:30:33 -08:00
parent f4d335e985
commit 1cea007c92
5 changed files with 34 additions and 42 deletions

View File

@@ -1283,7 +1283,7 @@ miniflow_and_mask_matches_flow(const struct miniflow *flow,
{
const uint32_t *flowp = miniflow_get_u32_values(flow);
const uint32_t *maskp = miniflow_get_u32_values(&mask->masks);
uint32_t idx;
int idx;
MAP_FOR_EACH_INDEX(idx, mask->masks.map) {
uint32_t diff = (*flowp++ ^ flow_u32_value(target, idx)) & *maskp++;
@@ -1326,7 +1326,7 @@ miniflow_and_mask_matches_flow_wc(const struct miniflow *flow,
{
const uint32_t *flowp = miniflow_get_u32_values(flow);
const uint32_t *maskp = miniflow_get_u32_values(&mask->masks);
uint32_t idx;
int idx;
MAP_FOR_EACH_INDEX(idx, mask->masks.map) {
uint32_t mask = *maskp++;