summaryrefslogtreecommitdiff
path: root/ofproto/pinsched.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-06-03 10:17:51 -0700
committerBen Pfaff <blp@nicira.com>2010-06-17 10:30:19 -0700
commite3648418c4bf028e6bca38bcbfc5a5ed493447fb (patch)
tree7dd179a64f54049d22fef0fd3a133874b72c36ce /ofproto/pinsched.c
parentff4ed3c9a1911821f16b49b5ebb5b64a9c5d907c (diff)
downloadopenvswitch-e3648418c4bf028e6bca38bcbfc5a5ed493447fb.tar.gz
port-array: Add port_array_delete() function.
port_array_delete(pa, idx) is equivalent to port_array_set(pa, idx, NULL), but it never allocates memory and avoids conditionals.
Diffstat (limited to 'ofproto/pinsched.c')
-rw-r--r--ofproto/pinsched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c
index 6af2bb676..d749ee4e6 100644
--- a/ofproto/pinsched.c
+++ b/ofproto/pinsched.c
@@ -70,7 +70,7 @@ dequeue_packet(struct pinsched *ps, struct ovs_queue *q,
struct ofpbuf *packet = queue_pop_head(q);
if (!q->n) {
free(q);
- port_array_set(&ps->queues, port_no, NULL);
+ port_array_delete(&ps->queues, port_no);
}
ps->n_queued--;
return packet;