-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ced2022
commit 32b1234
Showing
3 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Dave DeLong on 2/4/24. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Fixed: Equatable { | ||
|
||
/// Determine if two `Fixed` values are equal. | ||
/// | ||
/// Two `Fixed` values are equal if they have the same `Region` and represent the same calendrical components. | ||
/// - Parameter lhs: a `Fixed` value | ||
/// - Parameter rhs: a `Fixed` value | ||
public static func ==(lhs: Self, rhs: Self) -> Bool { | ||
return lhs.region == rhs.region && lhs.dateComponents == rhs.dateComponents | ||
} | ||
|
||
} | ||
|
||
extension Fixed: Hashable { | ||
|
||
/// Compute the hash of an`Fixed` value | ||
/// | ||
/// - Parameter hasher: a `Hasher` | ||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(region) | ||
hasher.combine(dateComponents) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters