ofproto: Use shash_find_and_delete() in ofport_destroy__().
This is shorter and slightly safer than combining calls to shash_find()
and shash_delete().
Found by Coverity.
Reported-at:
Acked-by: Justin Pettit
@@ -2511,8 +2511,7 @@ ofport_destroy__(struct ofport *port)
const char *name = netdev_get_name(port->netdev);
hmap_remove(&ofproto->ports, &port->hmap_node);
- shash_delete(&ofproto->port_by_name,
- shash_find(&ofproto->port_by_name, name));
+ shash_find_and_delete(&ofproto->port_by_name, name);
netdev_close(port->netdev);
ofproto->ofproto_class->port_dealloc(port);
