Re: [PATCH v5 4/8] convert: Separate generic structures and variables from the filter specific ones

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

 



Lars Schneider <larsxschneider@xxxxxxxxx> writes:

>> -static struct cmd2process *find_multi_file_filter_entry(struct hashmap *hashmap, const char *cmd)
>> +static struct subprocess_entry *find_multi_file_filter_entry(const char *cmd)
>
> I am curious why you removed the hashmap parameter (here and in other pars of this patch). 
> I know the parameter is not strictly necessary as the hashmap is a global variable anyways. 
> However, I think it eases code maintainability in the long run if a function is "as pure as 
> possible" (IOW does rely on global state as less as possible).

If the original relied on a global hashmap and this update kept the
code like so, I wouldn't mind the end result of this series
(i.e. rely on it being global).  But that is not the case.  It is
making the code worse by stopping passing the hashmap through the
callchain.



[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]