Page MenuHomePhabricator

Consider "msort()" on "PhutilSortVector" objects to be an error
ClosedPublic

Authored by epriestley on Jun 17 2019, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 4, 8:53 AM
Unknown Object (File)
Tue, Jun 3, 10:35 AM
Unknown Object (File)
Sat, May 31, 10:11 AM
Unknown Object (File)
May 30 2025, 7:01 PM
Unknown Object (File)
May 8 2025, 11:40 AM
Unknown Object (File)
Apr 21 2025, 2:42 PM
Unknown Object (File)
Apr 13 2025, 12:42 PM
Unknown Object (File)
Apr 5 2025, 1:19 PM
Subscribers
None

Details

Summary

Ref T13303. If someone upgrades from "msort()" to "msortv()" to get sort stability, but forgets to type a "v", the code executes but likely does not do what this hypothetical person intended.

Consider this an error, since I can come up with no conceivable reason to "msort()" using a method which returns "PhutilSortVector": this means you've done the legwork to stabilize the sort but are choosing unstable behavior, which makes little sense.

Test Plan

See next change.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable