Try sorting

This commit is contained in:
2026-04-12 19:51:59 -07:00
parent 4563e1ef4a
commit 59b5eade7e

View File

@@ -116,7 +116,10 @@ impl BlockQ4KRle {
/// ///
/// The `d`, `dmin`, and `scales` fields are always copied verbatim. /// The `d`, `dmin`, and `scales` fields are always copied verbatim.
pub fn encode(block: &BlockQ4K) -> BlockQ4KRle { pub fn encode(block: &BlockQ4K) -> BlockQ4KRle {
let raw = &block.qs; let mut raw = Vec::from(&block.qs);
// Sort the raw numbers
raw.sort();
// Scan the 128-byte raw payload for runs of equal bytes. // Scan the 128-byte raw payload for runs of equal bytes.
let mut pairs: Vec<(u8, u8)> = Vec::with_capacity(64); let mut pairs: Vec<(u8, u8)> = Vec::with_capacity(64);