mutating func updateValue()

in Sources/CollectionsBenchmark/Utilities/_SimpleSortedDictionary.swift [154:166]


  mutating func updateValue(
    _ value: Value,
    forKey key: Key
  ) -> Value? {
    let (found, index) = _elements._binarySearchStart(key, by: { $0.key })
    if found {
      let old = _elements[index].value
      _elements[index].value = value
      return old
    }
    _elements.insert(_Item(key, value), at: index)
    return nil
  }