On Sat, 2018-11-24 at 15:04 +0100, Michael Osipov wrote:
> Am 2018-11-23 um 09:20 schrieb Oleg Kalnichevski:> On Thu, 2018-11-22 
> at 
> 20:12 -0700, Gary Gregory wrote:
>  >> Hi All:
>  >>
>  >> In the HC code base, we could avoid some boilerplate clutter by
> using
>  >> Java's enhanced for-loop construct. I believe this would make the
>  >> code
>  >> easier to read. Are there any objections to making this change?
>  >>
>  >> Gary
>  >
>  > I am _strongly_ against it. Last time you did that it had caused
> us a
>  > lot of grief.
>  >
>  > https://issues.apache.org/jira/browse/HTTPCORE-361
> That's an interesting case because it is an antipattern to access 
> collections via index. The recommended way is to use iterators. Why
> have 
> create the iterator directly and call next() once? Still to much
> overhead?
> 
> Michael

This is what one unnecessary object allocation in a critical execution
path can do to you.

Strongly disagree about collection element access by index being an
anti-pattern. Who invents this kind of stuff?

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to