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

Unified Diff: pkg/fixnum/lib/src/int64.dart

Issue 875323002: Cleanup IntX to implement Comparable<FixNum> which is more descriptive than Comparable as it would … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | « pkg/fixnum/lib/src/int32.dart ('k') | pkg/fixnum/lib/src/intx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fixnum/lib/src/int64.dart
diff --git a/pkg/fixnum/lib/src/int64.dart b/pkg/fixnum/lib/src/int64.dart
index de3065643760910bd1a2c667177561eb8f629102..603065c19b7beec97e81333a1f6e9f3d7313a34a 100644
--- a/pkg/fixnum/lib/src/int64.dart
+++ b/pkg/fixnum/lib/src/int64.dart
@@ -469,7 +469,9 @@ class Int64 implements IntX {
return false;
}
- int compareTo(Comparable other) {
+ int compareTo(IntX other) =>_compareTo(other);
+
+ int _compareTo(other) {
Int64 o = _promote(other);
int signa = _h >> (_BITS2 - 1);
int signb = o._h >> (_BITS2 - 1);
@@ -494,21 +496,10 @@ class Int64 implements IntX {
return 0;
}
- bool operator <(other) {
- return this.compareTo(other) < 0;
- }
-
- bool operator <=(other) {
- return this.compareTo(other) <= 0;
- }
-
- bool operator >(other) {
- return this.compareTo(other) > 0;
- }
-
- bool operator >=(other) {
- return this.compareTo(other) >= 0;
- }
+ bool operator <(other) => _compareTo(other) < 0;
+ bool operator <=(other) => _compareTo(other) <= 0;
+ bool operator >(other) => this._compareTo(other) > 0;
+ bool operator >=(other) => _compareTo(other) >= 0;
bool get isEven => (_l & 0x1) == 0;
bool get isMaxValue => (_h == _MASK2 >> 1) && _m == _MASK && _l == _MASK;
« no previous file with comments | « pkg/fixnum/lib/src/int32.dart ('k') | pkg/fixnum/lib/src/intx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698