~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to lib/list.c

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
 
2
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
3
3
 *
4
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
5
 * you may not use this file except in compliance with the License.
46
46
void
47
47
list_splice(struct list *before, struct list *first, struct list *last)
48
48
{
49
 
    if (first == last)
 
49
    if (first == last) {
50
50
        return;
 
51
    }
51
52
    last = last->prev;
52
53
 
53
54
    /* Cleanly remove 'first'...'last' from its current list. */
160
161
    const struct list *e;
161
162
    size_t cnt = 0;
162
163
 
163
 
    for (e = list->next; e != list; e = e->next)
 
164
    for (e = list->next; e != list; e = e->next) {
164
165
        cnt++;
 
166
    }
165
167
    return cnt;
166
168
}
167
169