Skip to content

Commit

Permalink
strmap: make callers of strmap_remove() to call it in void context
Browse files Browse the repository at this point in the history
Two "static inline" functions, both of which return void, call
strmap_remove() and tries to return the value it returns as their
return value, which is just bogus, as strmap_remove() returns void
itself.  Call it in the void context and fall-thru the control to
the end instead.

Reported-by: Randall S. Becker <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
gitster committed Dec 15, 2020
1 parent 449a900 commit 37e7323
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions strmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static inline int strintmap_contains(struct strintmap *map, const char *str)

static inline void strintmap_remove(struct strintmap *map, const char *str)
{
return strmap_remove(&map->map, str, 0);
strmap_remove(&map->map, str, 0);
}

static inline int strintmap_empty(struct strintmap *map)
Expand Down Expand Up @@ -249,7 +249,7 @@ static inline int strset_contains(struct strset *set, const char *str)

static inline void strset_remove(struct strset *set, const char *str)
{
return strmap_remove(&set->map, str, 0);
strmap_remove(&set->map, str, 0);
}

static inline int strset_empty(struct strset *set)
Expand Down

0 comments on commit 37e7323

Please sign in to comment.