Skip to content

Commit

Permalink
Add hash code and equality operator
Browse files Browse the repository at this point in the history
As requested in #1.
  • Loading branch information
jim-ec committed May 21, 2019
1 parent 45ca6c7 commit 5533142
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/angles_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,11 @@ class Angle implements Comparable<Angle> {

@override
int compareTo(Angle other) => this == other ? 0 : this > other ? 1 : -1;

@override
int get hashCode => _storage.hashCode;

@override
bool operator ==(covariant Angle rhs) => _storage == rhs._storage;

}

0 comments on commit 5533142

Please sign in to comment.