Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/58992 )
Change subject: util/lint/kconfig_lint: Fix off by one error that missed last line ......................................................................
Patch Set 1:
(1 comment)
File util/lint/kconfig_lint:
https://review.coreboot.org/c/coreboot/+/58992/comment/a641b250_ceca01d0 PS1, Line 1315: $#wholeconfig
Not an expert, but could we use `< @wholeconfig`? I think that might […]
As typical in perl, there are always various ugly ways to do anything.
I think the above way is the generally recommended way to do it in perl, but $# returns the value of the last entry, not the size, which was the issue here.
I'm not sure right now about @wholeconfig either - can test it at some point. The question is whether comparing to a scalar would put it into an implicit scalar context or not. It definitely might.
Ways that definitely work by making it an implicit or explicit scalar value:
scalar(@wholeconfig)
0+@wholeconfig
my $configsize = @wholeconfig; for (my $i = 0 ; $i < configsize; $i++) {
I'll test @wholeconfig and change it to that if it works. If not, but still you'd prefer a different syntax to $#wholeconfig, I think I'd rather use the separate variable for clarity. I'm not attached to any particular method.