Make compile-time constants in _IntegerImplementation.compareTo const.

Review URL: https://codereview.chromium.org//298203002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36864 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
fschneider@google.com
2014-06-02 11:10:06 +00:00
parent 7387419911
commit fc7d8c61ba
+3 -4
View File
@@ -117,11 +117,10 @@ class _IntegerImplementation {
}
int compareTo(num other) {
final int EQUAL = 0, LESS = -1, GREATER = 1;
const int EQUAL = 0, LESS = -1, GREATER = 1;
if (other is double) {
// TODO(floitsch): the following locals should be 'const'.
int MAX_EXACT_INT_TO_DOUBLE = 9007199254740992; // 2^53.
int MIN_EXACT_INT_TO_DOUBLE = -MAX_EXACT_INT_TO_DOUBLE;
const int MAX_EXACT_INT_TO_DOUBLE = 9007199254740992; // 2^53.
const int MIN_EXACT_INT_TO_DOUBLE = -MAX_EXACT_INT_TO_DOUBLE;
double d = other;
if (d.isInfinite) {
return d == double.NEGATIVE_INFINITY ? GREATER : LESS;