Skip to content

CAT 001

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-001 — sort.first → min/max

Field Value
Severity warning
Confidence high
Auto-fix

sort.first → min/max — Use min/max instead of sort/first/last to avoid O(n log n) sorting when O(n) scanning suffices.

Bad code

ary.sort.first
ary.sort.last

Good code

ary.min
ary.max

Clone this wiki locally