summaryrefslogtreecommitdiff
path: root/ovsdb/relay.c
diff options
context:
space:
mode:
authorAdrian Moreno <amorenoz@redhat.com>2022-03-23 12:56:17 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-30 16:59:02 +0200
commit9e56549c2bba79e644de2d3876b363553175210c (patch)
treebf0bf39f86c3e63eda7171f727a6ca3dcc69922b /ovsdb/relay.c
parent860e69a8c3d6994dc000b37d682bd16cd2925bef (diff)
downloadopenvswitch-9e56549c2bba79e644de2d3876b363553175210c.tar.gz
hmap: use short version of safe loops if possible.
Using SHORT version of the *_SAFE loops makes the code cleaner and less error prone. So, use the SHORT version and remove the extra variable when possible for hmap and all its derived types. In order to be able to use both long and short versions without changing the name of the macro for all the clients, overload the existing name and select the appropriate version depending on the number of arguments. Acked-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb/relay.c')
-rw-r--r--ovsdb/relay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ovsdb/relay.c b/ovsdb/relay.c
index 2df393403..9ff6ed8f3 100644
--- a/ovsdb/relay.c
+++ b/ovsdb/relay.c
@@ -280,9 +280,9 @@ ovsdb_relay_clear(struct ovsdb *db)
SHASH_FOR_EACH (table_node, &db->tables) {
struct ovsdb_table *table = table_node->data;
- struct ovsdb_row *row, *next;
+ struct ovsdb_row *row;
- HMAP_FOR_EACH_SAFE (row, next, hmap_node, &table->rows) {
+ HMAP_FOR_EACH_SAFE (row, hmap_node, &table->rows) {
ovsdb_txn_row_delete(txn, row);
}
}