Insert into a sorted list, returning `None` if already present.
(a: u64, list: &[u64])
| 352 | |
| 353 | fn norm_add_const(s: &mut NormLevel, k: u64, path: &[u64]) { |
| 354 | if k == 0 || (k == 1 && !path.is_empty()) { |
| 355 | return; |
| 356 | } |
| 357 | let node = s.entry(path.to_vec()).or_default(); |
| 358 | node.constant = node.constant.max(k); |
| 359 | } |
| 360 | |
| 361 | /// Insert into a sorted list, returning `None` if already present. |
| 362 | fn ordered_insert(a: u64, list: &[u64]) -> Option<Vec<u64>> { |
| 363 | match list.binary_search(&a) { |
| 364 | Ok(_) => None, |
| 365 | Err(pos) => { |
| 366 | let mut result = list.to_vec(); |
no test coverage detected