swiftlang / swift-corelibs-libdispatch

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware
swift.org
Apache License 2.0
2.47k stars 460 forks source link

Mark DispatchTimeInterval Equatable #782

Closed rnro closed 1 year ago

rnro commented 1 year ago

We can mark DispatchTimeInterval as equatable because it already implements the equality check operator ==.

This resolves an API disparity - on Darwin DispatchTimeInterval is already Equatable.

Doing this will allow DispatchTimeInterval to be used with a wide range of library functions which are defined to operate on Equatable objects. For example this is useful in tests when you might wish to use XCTAssertEqual.

Resolves https://github.com/apple/swift-corelibs-libdispatch/issues/669

MaxDesiatov commented 1 year ago

@swift-ci test