Further reduce required manual comparisons

quickdudley
Jan 23, 2022, 3:37 AM
FOUJ5RXTAO6PY6XKGATFZSCQZVCWHGFF4FIY6EEMLL7EE4CWAQ7AC

Dependencies

  • [2] 5PUWL3CL Fix off by one error
  • [3] UICD2BGD Possibly use a better pivot in the sponge loop
  • [4] AOO3FCSG Cargo clippy, tweaks, etc
  • [5] QEKHTVB7 Get most things semi-working except the final sort
  • [6] CYDK6S5L Fix bugs
  • [7] 5OUVESUQ Attempt to reduce additional manual comparison upon resume
  • [8] MFGAW2Q2 Cache preferences in memory
  • [*] 5Y7ZXB53 Start picker UI

Change contents

  • edit in src/pick.rs at line 14
    [3.180]
    [3.180]
    use std::cmp::Ordering;
  • replacement in src/pick.rs at line 113
    [3.1149][3.1149:1182]()
    let j: *mut IDedName = {
    [3.1149]
    [3.2365]
    let mut j: *mut IDedName = {
  • replacement in src/pick.rs at line 118
    [2.80][3.76:106](),[3.76][3.76:106]()
    while i < threshold {
    [2.80]
    [3.106]
    'sieve: loop {
  • replacement in src/pick.rs at line 123
    [3.261][3.2549:2618](),[3.2549][3.2549:2618]()
    i = unsafe { comparator.partition(i, j, pivot).await? };
    [3.261]
    [3.2618]
    let pivot = unsafe { comparator.partition(i, j, pivot).await? };
    match pivot.cmp(&threshold) {
    Ordering::Less => {
    i = unsafe { pivot.offset(1) };
    }
    Ordering::Equal => {
    break 'sieve;
    }
    Ordering::Greater => {
    j = pivot;
    }
    }
  • replacement in src/pick.rs at line 136
    [3.2628][3.2628:2730]()
    unsafe {
    shortlist.truncate(1 + i.offset_from(&shortlist[0]) as usize)
    };
    [3.2628]
    [3.123]
    shortlist.truncate(count as usize);
  • replacement in src/pick.rs at line 199
    [3.1512][3.667:702](),[3.3181][3.667:702]()
    use std::cmp::Ordering::*;
    [3.1512]
    [3.3181]
    use Ordering::*;
  • replacement in src/pick.rs at line 228
    [3.1557][3.4100:4141](),[3.4100][3.4100:4141]()
    ) -> DynResult<std::cmp::Ordering> {
    [3.1557]
    [3.980]
    ) -> DynResult<Ordering> {
  • replacement in src/pick.rs at line 242
    [3.4978][3.4978:5057]()
    break (std::cmp::Ordering::Greater, a.1, b.1);
    [3.4978]
    [3.5057]
    break (Ordering::Greater, a.1, b.1);
  • replacement in src/pick.rs at line 245
    [3.5135][3.5135:5211]()
    break (std::cmp::Ordering::Less, b.1, a.1);
    [3.5135]
    [3.5211]
    break (Ordering::Less, b.1, a.1);