On Fri, Nov 02, 2018 at 03:28:00PM +0200, Gabriel Ivăncescu wrote:
On Fri, Nov 2, 2018 at 1:45 PM Huw Davies huw@codeweavers.com wrote:
Missed this before, but this is an unnecessary change. Let's also have a blank line between variable declarations and code.
Ok.
I mentioned the variable names in this function last time. 'i' and 'k' would be ok for loops, but here they're not used in that way; 'start' and 'end' would be much better choices. And like I said, then you really don't need 'cnt' at all.
But then I'd still need an 'i' to iterate through when inserting the strings, if I don't use cnt (since it's needed for show_listbox below). I won't be able to do end - start there if I change start...
So net effect isn't really better compared to cnt (same amount of variables; instead of cnt, start, end we'll need i, start, end), though renaming the vars sounds like a good idea.
Right, sorry, I missed that you use cnt in show_listbox(). So yeah, rename i -> start, k -> end, then either use cnt and increment start in the loop, or use a i in the loop without cnt. I don't mind either way.
Huw.