From fe78f2fc0baa68aa2b9c0125c1b89dc23121d68b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 27 Sep 2021 15:40:03 +0300 Subject: Use .sort_unstable for speed A stable sort is one where values that compare equal are in the same order relative to each other in the output as they were in the input. Thus, if input has values a0, b, and a1, with a0==a1, a0 Reader<'a> { // If there are no dashes at all, match on the BEGIN. valid_start.push(b'B'); - valid_start.sort(); + valid_start.sort_unstable(); valid_start.dedup(); valid_start }; @@ -858,7 +858,7 @@ impl<'a> Reader<'a> { // If there are no dashes at all, match on the BEGIN. valid_start.push(b'B'); - valid_start.sort(); + valid_start.sort_unstable(); valid_start.dedup(); valid_start }; -- cgit v1.2.3