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:
authorCampbell Barton <ideasman42@gmail.com>2016-06-06 12:09:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-06-06 12:12:13 +0300
commit24049c8196ccb88eadc5930e780151c1c0da6a27 (patch)
tree832bda7582ba31c4b27065cfad48dc0ca160849b
parent5d45ffc755e3c7961cadd007e7440ec1fe8b6dbe (diff)
readfile: add assert to check libmap isn't sorted
-rw-r--r--source/blender/blenloader/intern/readfile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index df36def5ba1..96a9c4442d9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -222,7 +222,7 @@ typedef struct OldNew {
typedef struct OldNewMap {
OldNew *entries;
int nentries, entriessize;
- int sorted;
+ bool sorted;
int lasthit;
} OldNewMap;
@@ -288,6 +288,7 @@ static int verg_oldnewmap(const void *v1, const void *v2)
static void oldnewmap_sort(FileData *fd)
{
+ BLI_assert(fd->libmap->sorted == false);
qsort(fd->libmap->entries, fd->libmap->nentries, sizeof(OldNew), verg_oldnewmap);
fd->libmap->sorted = 1;
}
@@ -1509,6 +1510,9 @@ static void change_idid_adr_fd(FileData *fd, const void *old, void *new)
{
int i;
+ /* use a binary search if we have a sorted libmap, for now it's not needed. */
+ BLI_assert(fd->libmap->sorted == false);
+
for (i = 0; i < fd->libmap->nentries; i++) {
OldNew *entry = &fd->libmap->entries[i];