mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
hashmap: add some asserts
Quiet down static code analysis.
This commit is contained in:
@@ -340,6 +340,9 @@ typedef uint32_t git_hashmap_iter_t;
|
||||
int error = name##__put_idx(&idx, &key_exists, h, key); \
|
||||
if (error) \
|
||||
return error; \
|
||||
GIT_ASSERT((h)->flags); \
|
||||
GIT_ASSERT((h)->keys); \
|
||||
GIT_ASSERT((h)->keys); \
|
||||
if (!key_exists) \
|
||||
(h)->keys[idx] = key; \
|
||||
(h)->vals[idx] = val; \
|
||||
@@ -382,8 +385,11 @@ typedef uint32_t git_hashmap_iter_t;
|
||||
int error = name##__put_idx(&idx, &key_exists, h, key); \
|
||||
if (error) \
|
||||
return error; \
|
||||
if (!key_exists) \
|
||||
GIT_ASSERT((h)->flags); \
|
||||
GIT_ASSERT((h)->keys); \
|
||||
if (!key_exists) { \
|
||||
(h)->keys[idx] = key; \
|
||||
} \
|
||||
return 0; \
|
||||
} \
|
||||
GIT_UNUSED_FUNCTION scope int name##_iterate(git_hashmap_iter_t *iter, key_t *key, name *h) \
|
||||
|
||||
Reference in New Issue
Block a user