Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2007-12-11 00:04:48 +0300
committerMartin Poirier <theeth@yahoo.com>2007-12-11 00:04:48 +0300
commit23a525c52d4f000d4831e17c0795ef9235987601 (patch)
tree6e57a81f48a33101efa38d1f44d82f39059e56f2 /source/blender/blenlib
parent9f76c42c00a4724a635b6792e36e5abb3101db81 (diff)
== Code sweeping ==
BLI_sortlist simplifications
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/util.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 9ababcae39d..dc2e53483db 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -324,9 +324,10 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *))
if (listbase->first != listbase->last)
{
- for( previous = listbase->first, current = previous->next; current; previous = current, current = next )
+ for( previous = listbase->first, current = previous->next; current; current = next )
{
next = current->next;
+ previous = current->prev;
BLI_remlink(listbase, current);
@@ -335,14 +336,7 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *))
previous = previous->prev;
}
- if (previous == NULL)
- {
- BLI_addhead(listbase, current);
- }
- else
- {
- BLI_insertlinkafter(listbase, previous, current);
- }
+ BLI_insertlinkafter(listbase, previous, current);
}
}
}