Skip to content

Commit 1f1e11a

Browse files
committed
Quicker sort
1 parent 1f73ba3 commit 1f1e11a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mediancut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'hist> MBox<'hist> {
103103
ChanVariance { chan: 2, variance: vars[2] },
104104
ChanVariance { chan: 3, variance: vars[3] },
105105
];
106-
channels.sort_by_key(|a| Reverse(OrdFloat::new(a.variance)));
106+
channels.sort_unstable_by_key(|a| Reverse(OrdFloat::new(a.variance)));
107107

108108
for a in self.colors.iter_mut() {
109109
let chans: [f32; 4] = rgb::bytemuck::cast(a.color.0);

0 commit comments

Comments
 (0)