Performance optimization for minElement and maxElement

Ogi ogion.art at gmail.com
Mon Sep 12 13:13:57 UTC 2022


On Monday, 12 September 2022 at 11:53:34 UTC, Sergey wrote:
> In case zero will be the last element - the search should make 
> an extra comparisons “if currentElement = T.minimum” which 
> double operations..
> Isn’t it?

Branch prediction makes this extra check basically free.


More information about the Digitalmars-d mailing list