apple / swift-algorithms

Commonly used sequence and collection algorithms for Swift
Apache License 2.0
5.9k stars 435 forks source link

[minmax] Do nothing for empty suffix/prefix. #202

Closed ttsugriy closed 9 months ago

ttsugriy commented 11 months ago

Semantically it's a noop but it's slightly more efficient for the case when max/min is requested for an empty Collection.

stephentyrone commented 9 months ago

@swift-ci test

natecook1000 commented 9 months ago

@swift-ci Please test

natecook1000 commented 9 months ago

Thanks for this fix, @ttsugriy! 👏🏻