Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: lib/src/version_range.dart

Issue 687973004: Add VersionRange.hashCode. (Closed) Base URL: git@github.com:dart-lang/pub_semver@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/version_range.dart
diff --git a/lib/src/version_range.dart b/lib/src/version_range.dart
index 7020077a7fdfa101051f3122d691dc3bb31efa96..faffb4742335f9d207bc5a86a545a7b925a1405d 100644
--- a/lib/src/version_range.dart
+++ b/lib/src/version_range.dart
@@ -66,6 +66,9 @@ class VersionRange implements VersionConstraint {
includeMax == other.includeMax;
}
+ int get hashCode => min.hashCode ^ (max.hashCode * 3) ^
+ (includeMin.hashCode * 5) ^ (includeMax.hashCode * 7);
Bob Nystrom 2014/10/30 16:45:24 Idle thought: these multiplications can push the r
+
bool get isEmpty => false;
bool get isAny => min == null && max == null;
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698