diff options
Diffstat (limited to 'source/blender/blenlib/intern/array_store.c')
-rw-r--r-- | source/blender/blenlib/intern/array_store.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index a6a0c21b104..847cb42186a 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -112,6 +112,7 @@ /* only for BLI_array_store_is_valid */ #include "BLI_ghash.h" +/* -------------------------------------------------------------------- */ /** \name Defines * * Some of the logic for merging is quite involved, @@ -206,6 +207,7 @@ /** \} */ +/* -------------------------------------------------------------------- */ /** \name Internal Structs * \{ */ @@ -313,6 +315,7 @@ typedef struct BTableRef { static size_t bchunk_list_size(const BChunkList *chunk_list); +/* -------------------------------------------------------------------- */ /** \name Internal BChunk API * \{ */ @@ -360,6 +363,7 @@ static bool bchunk_data_compare(const BChunk *chunk, /** \} */ +/* -------------------------------------------------------------------- */ /** \name Internal BChunkList API * \{ */ @@ -732,10 +736,11 @@ static void bchunk_list_fill_from_array(const BArrayInfo *info, /** \} */ -/* --------------------------------------------------------------------------- +/* * Internal Table Lookup Functions */ +/* -------------------------------------------------------------------- */ /** \name Internal Hashing/De-Duplication API * * Only used by #bchunk_list_from_data_merge @@ -1005,6 +1010,7 @@ static const BChunkRef *table_lookup(const BArrayInfo *info, /** \} */ +/* -------------------------------------------------------------------- */ /** \name Main Data De-Duplication Function * * \{ */ @@ -1307,7 +1313,7 @@ static BChunkList *bchunk_list_from_data_merge(const BArrayInfo *info, ASSERT_CHUNKLIST_DATA(chunk_list, data); /* its likely that the next chunk in the list will be a match, so check it! */ - while ((cref_found->next != NULL) && (cref_found->next != chunk_list_reference_last)) { + while (!ELEM(cref_found->next, NULL, chunk_list_reference_last)) { cref_found = cref_found->next; BChunk *chunk_found = cref_found->link; @@ -1390,6 +1396,7 @@ static BChunkList *bchunk_list_from_data_merge(const BArrayInfo *info, /** \} */ +/* -------------------------------------------------------------------- */ /** \name Main Array Storage API * \{ */ @@ -1405,7 +1412,7 @@ static BChunkList *bchunk_list_from_data_merge(const BArrayInfo *info, * * \param chunk_count: Number of elements to split each chunk into. * - A small value increases the ability to de-duplicate chunks, - * but adds overhead by increasing the number of chunks to look-up when searching for duplicates, + * but adds overhead by increasing the number of chunks to look up when searching for duplicates, * as well as some overhead constructing the original array again, with more calls to ``memcpy``. * - Larger values reduce the *book keeping* overhead, * but increase the chance a small, @@ -1496,6 +1503,7 @@ void BLI_array_store_clear(BArrayStore *bs) /** \} */ +/* -------------------------------------------------------------------- */ /** \name BArrayStore Statistics * \{ */ @@ -1530,6 +1538,7 @@ size_t BLI_array_store_calc_size_compacted_get(const BArrayStore *bs) /** \} */ +/* -------------------------------------------------------------------- */ /** \name BArrayState Access * \{ */ @@ -1653,6 +1662,7 @@ void *BLI_array_store_state_data_get_alloc(BArrayState *state, size_t *r_data_le /** \} */ +/* -------------------------------------------------------------------- */ /** \name Debugging API (for testing). * \{ */ |