SIGN IN SIGN UP

Use numeric comparator when sorting mimetype indices in MimeTypeDisplayOrder.prioritize (#316826)

Use numeric comparator when sorting mimetype indices

MimeTypeDisplayOrder.prioritize sorted numeric indices with the default Array.prototype.sort, which compares values as strings. Once the display order grows to ~10+ mimetypes, indices like [2, 10] sort to [10, 2] so the reverse-iteration splice loop removes the wrong rows and the final order corrupts (duplicate / missing mimetypes). Pass an ascending numeric comparator. Adds a regression test with 12 mimetypes.
D
Dmitriy Vasyura committed
5b8bdd020dfab8640c8db16e5742268dea7a7d05
Parent: ada6c2e
Committed by GitHub <noreply@github.com> on 5/18/2026, 5:58:11 PM