杨锴
2025-03-11 90dc3329d1973fda691e357cf4523d5c7c67fa1d
Pods/SwifterSwift/Sources/SwifterSwift/SwiftStdlib/MutableCollectionExtensions.swift
@@ -12,7 +12,7 @@
    /// SwifterSwift: Sort the collection based on a keypath.
    ///
    /// - Parameter keyPath: Key path to sort by. The key path type must be Comparable.
    mutating func sort<T: Comparable>(by keyPath: KeyPath<Element, T>) {
    mutating func sort(by keyPath: KeyPath<Element, some Comparable>) {
        sort { $0[keyPath: keyPath] < $1[keyPath: keyPath] }
    }
@@ -22,8 +22,8 @@
    /// - Parameters:
    ///     - keyPath1: Key path to sort by. Must be Comparable.
    ///     - keyPath2: Key path to sort by in case the values of `keyPath1` match. Must be Comparable.
    mutating func sort<T: Comparable, U: Comparable>(by keyPath1: KeyPath<Element, T>,
                                                     and keyPath2: KeyPath<Element, U>) {
    mutating func sort(by keyPath1: KeyPath<Element, some Comparable>,
                       and keyPath2: KeyPath<Element, some Comparable>) {
        sort {
            if $0[keyPath: keyPath1] != $1[keyPath: keyPath1] {
                return $0[keyPath: keyPath1] < $1[keyPath: keyPath1]
@@ -39,9 +39,9 @@
    ///     - keyPath1: Key path to sort by. Must be Comparable.
    ///     - keyPath2: Key path to sort by in case the values of `keyPath1` match. Must be Comparable.
    ///     - keyPath3: Key path to sort by in case the values of `keyPath1` and `keyPath2` match. Must be Comparable.
    mutating func sort<T: Comparable, U: Comparable, V: Comparable>(by keyPath1: KeyPath<Element, T>,
                                                                    and keyPath2: KeyPath<Element, U>,
                                                                    and keyPath3: KeyPath<Element, V>) {
    mutating func sort(by keyPath1: KeyPath<Element, some Comparable>,
                       and keyPath2: KeyPath<Element, some Comparable>,
                       and keyPath3: KeyPath<Element, some Comparable>) {
        sort {
            if $0[keyPath: keyPath1] != $1[keyPath: keyPath1] {
                return $0[keyPath: keyPath1] < $1[keyPath: keyPath1]