summaryrefslogtreecommitdiff
path: root/lib/netdev.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-06-30 13:28:22 -0700
committerBen Pfaff <blp@nicira.com>2010-06-30 16:48:55 -0700
commitefdd908807544de7bee8644fafc1400e6a32d936 (patch)
tree3cf8096adb7b7e125e568e18dbe26d8be205dad4 /lib/netdev.c
parentc6c9e1e36fdd9fe05e3d08a5e8fcceca13efd58a (diff)
downloadopenvswitch-efdd908807544de7bee8644fafc1400e6a32d936.tar.gz
Simplify shash_find() followed by shash_add() into shash_add_once().
This is just a cleanup.
Diffstat (limited to 'lib/netdev.c')
-rw-r--r--lib/netdev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/netdev.c b/lib/netdev.c
index dc27fd749..38f4dd585 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -1483,9 +1483,7 @@ netdev_monitor_cb(struct netdev_notifier *notifier)
{
struct netdev_monitor *monitor = notifier->aux;
const char *name = netdev_get_name(notifier->netdev);
- if (!shash_find(&monitor->changed_netdevs, name)) {
- shash_add(&monitor->changed_netdevs, name, NULL);
- }
+ shash_add_once(&monitor->changed_netdevs, name, NULL);
}
/* Attempts to add 'netdev' as a netdev monitored by 'monitor'. Returns 0 if