Fix bugs

[?]
Jan 16, 2022, 7:39 PM
CYDK6S5LRLGTPA4BX4XUNKCX6E6PIEFQXVX7KJAJ6HBMFDDJUPBQC

Dependencies

  • [2] QEKHTVB7 Get most things semi-working except the final sort
  • [3] 5Y7ZXB53 Start picker UI
  • [4] LLFG625I Should be all the database functions I need

Change contents

  • replacement in src/pick.rs at line 85
    [2.2187][2.2187:2231]()
    if shortlist.len() < count.into() {
    [2.2187]
    [2.2231]
    if shortlist.len() <= count.into() {
  • replacement in src/pick.rs at line 93
    [2.2451][2.2451:2523]()
    let pivot: *mut (String, i64) = &mut shortlist[count as usize];
    [2.2451]
    [2.2523]
    let pivot: *mut (String, i64) = &mut shortlist[count as usize - 1];
  • edit in src/pick.rs at line 100
    [2.2730]
    [2.2730]
    }
    {
    let len = shortlist.len();
    let mut stack: Vec<(*mut (String, i64), *mut (String, i64))> = vec![(&mut shortlist[0], &mut shortlist[len - 1])];
    while let Some((lo, hi)) = stack.pop() {
    unsafe {
    if lo < hi {
    let p = lo.offset(hi.offset_from(lo) / 2);
    let p = comparator.partition(lo, hi, p).await?;
    stack.extend_from_slice(&[(lo, p), (p.offset(1), hi)]);
    }
    }
    }
  • edit in src/pick.rs at line 116
    [2.2772]
    [3.348]
    for (rank, (name, _id)) in shortlist.into_iter().enumerate() {
    println!("{}: {}", rank + 1, name);
    }
  • replacement in src/pick.rs at line 142
    [2.3375][2.3375:3427]()
    std::cmp::Ordering::Less => (),
    [2.3375]
    [2.3427]
    std::cmp::Ordering::Greater => (),
  • replacement in src/pick.rs at line 149
    [2.3602][2.3602:3657]()
    std::cmp::Ordering::Greater => (),
    [2.3602]
    [2.3657]
    std::cmp::Ordering::Less => (),