tree-wide: use _contains() rather than _get()/_find()
This commit is contained in:
@@ -869,7 +869,7 @@ static int link_put_carrier(Link *link, Link *carrier, Hashmap **h) {
|
||||
if (link == carrier)
|
||||
return 0;
|
||||
|
||||
if (hashmap_get(*h, INT_TO_PTR(carrier->ifindex)))
|
||||
if (hashmap_contains(*h, INT_TO_PTR(carrier->ifindex)))
|
||||
return 0;
|
||||
|
||||
r = hashmap_ensure_put(h, NULL, INT_TO_PTR(carrier->ifindex), carrier);
|
||||
|
||||
@@ -128,7 +128,7 @@ TEST(route_tables) {
|
||||
test_route_tables_one(manager, "bbb", 11111);
|
||||
test_route_tables_one(manager, "ccc", 22222);
|
||||
|
||||
ASSERT_NULL(hashmap_get(manager->route_table_numbers_by_name, "ddd"));
|
||||
ASSERT_FALSE(hashmap_contains(manager->route_table_numbers_by_name, "ddd"));
|
||||
|
||||
test_route_tables_one(manager, "default", 253);
|
||||
test_route_tables_one(manager, "main", 254);
|
||||
|
||||
Reference in New Issue
Block a user