RE: [PATCH] strmap: make callers of strmap_remove() to call it in void context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Junio C Hamano <gitster@xxxxxxxxx>
> Sent: December 15, 2020 4:26 PM
> To: Elijah Newren <newren@xxxxxxxxx>; Randall S. Becker
> <rsbecker@xxxxxxxxxxxxx>
> Cc: Jeff King <peff@xxxxxxxx>; Git Mailing List <git@xxxxxxxxxxxxxxx>
> Subject: [PATCH] strmap: make callers of strmap_remove() to call it in
void
> context
> 
> 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 <rsbecker@xxxxxxxxxxxxx>
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
>  strmap.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/strmap.h b/strmap.h
> index c4c104411b..1e152d832d 100644
> --- a/strmap.h
> +++ b/strmap.h
> @@ -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) @@ -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)
> --
> 2.30.0-rc0-186-g20447144ec

Looks good from here.

Regards,
Randall




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux