2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +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

@@ -706,10 +706,10 @@ flow_union_with_miniflow(struct flow *dst, const struct miniflow *src)
{
uint32_t *dst_u32 = (uint32_t *) dst;
const uint32_t *p = miniflow_get_u32_values(src);
uint64_t map;
int idx;
for (map = src->map; map; map = zero_rightmost_1bit(map)) {
dst_u32[raw_ctz(map)] |= *p++;
MAP_FOR_EACH_INDEX(idx, src->map) {
dst_u32[idx] |= *p++;
}
}