bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Does gawk optimize length(row) in for-loop?


From: Andrew J. Schorr
Subject: Re: [bug-gawk] Does gawk optimize length(row) in for-loop?
Date: Sat, 25 Mar 2017 14:21:16 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Mar 25, 2017 at 02:18:20PM -0400, Andrew J. Schorr wrote:
> If you do know that they exist, then it's probably wiser to write:
>    for (i in row)
>       data[i] += row[i]
> But this loses the (desirable?) side-effect of creating empty row[i]
> entries for indices that are not already in the array.

(and also the side-effect of creating zero entries in the data array).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]