Performance optimization for minElement and maxElement

Ali Çehreli acehreli at yahoo.com
Mon Sep 12 17:19:03 UTC 2022


On 9/12/22 08:27, Steven Schveighoffer wrote:

 > For instance, uint.min is 0, this might be a common occurrence in some
 > ranges. But int.min is -2billion. That might *never* occur in some
 > ranges.

Makes sense. My mind caught this "optimization" (if at all) on unsigned 
types being 0. So I started writing the original post on unsigned types 
but generalized to all fundamental types as an afterthought. Even 
maxElement was added by generalization... :)

Yeah, I think this is about unsigned and 0.

Ali



More information about the Digitalmars-d mailing list