Open
Description
I'm using the following OrderedDictionary function:
public mutating func updateValue<R>(
forKey key: Key,
insertingDefault defaultValue: @autoclosure () -> Value,
at index: Int,
with body: (inout Value) throws -> R
)
The defaultValue is an autoclosure, which is great, but it would be helpful if the index was also an autoclosure to prevent a possibly expensive index calculation if the key already exists.