         areInIncreasingOrder: (Element, Element) throws -> Bool
     ) rethrows {
         let keysAndValues = try Array(unsorted).sorted(by: areInIncreasingOrder)
-        self.init(uniqueKeysWithValues: keysAndValues)
+        
+        self.init(
+            uniqueKeysWithValues: keysAndValues,
+            minimumCapacity: unsorted.count
+        )
     }
     
     /// Initializes an ordered dictionary from a sequence of values keyed by a unique key extracted

    // ======================================================= //
    
    /// The backing storage for the ordered keys.
    fileprivate var _orderedKeys = [Key]()
    
    /// The backing storage for the mapping of keys to values.
    fileprivate var _keysToValues = [Key: Value]()
    
}


    ///
    /// - Parameter keysAndValues: A sequence of key-value pairs to use for the new ordered
    ///   dictionary. Every key in `keysAndValues` must be unique.
    public init<S: Sequence>(
        uniqueKeysWithValues keysAndValues: S
    ) where S.Element == Element {
        self.init(
            uniqueKeysWithValues: keysAndValues,
            minimumCapacity: keysAndValues.underestimatedCount
        )
    }
    
    private init<S: Sequence>(
        uniqueKeysWithValues keysAndValues: S,
        minimumCapacity: Int
    ) where S.Element == Element {
        self.init(minimumCapacity: minimumCapacity)
        
        for (key, value) in keysAndValues {
            precondition(!containsKey(key), "Sequence of key-value pairs contains duplicate keys")
            self[key] = value
