Skip to content

Commit

Permalink
Updated UUID's Comparable conformance to be disfavored over Foundation's
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitribouniol committed Jun 19, 2024
1 parent ef63efb commit 3da4d93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/CodableDatastore/Indexes/UUID+Comparable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@

import Foundation

/// Make UUIDs comparable on platforms that shipped without it, so that they can be used transparently as an index.
#if swift(<5.9) || os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Linux) || os(Windows)
/// Make UUIDs comparable, so that they can be used transparently as an index.
#if compiler(>=6)
extension UUID: @retroactive Comparable {
@inlinable
@_disfavoredOverload
public static func < (lhs: UUID, rhs: UUID) -> Bool {
lhs.isLessThan(rhs: rhs)
}
}
#else
extension UUID: Comparable {
@inlinable
@_disfavoredOverload
public static func < (lhs: UUID, rhs: UUID) -> Bool {
lhs.isLessThan(rhs: rhs)
}
Expand Down

0 comments on commit 3da4d93

Please sign in to comment.