Index: pkg/source_span/lib/src/span_mixin.dart |
diff --git a/pkg/source_span/lib/src/span_mixin.dart b/pkg/source_span/lib/src/span_mixin.dart |
index 95a720aaef3a565ddaa22b31e463f87bdcaca2a4..716e6e07b1f4638c7ecce38a383e5546691f6717 100644 |
--- a/pkg/source_span/lib/src/span_mixin.dart |
+++ b/pkg/source_span/lib/src/span_mixin.dart |
@@ -21,8 +21,8 @@ abstract class SourceSpanMixin implements SourceSpan { |
int get length => end.offset - start.offset; |
int compareTo(SourceSpan other) { |
- int d = start.compareTo(other.start); |
- return d == 0 ? end.compareTo(other.end) : d; |
+ var result = start.compareTo(other.start); |
+ return result == 0 ? end.compareTo(other.end) : result; |
} |
SourceSpan union(SourceSpan other) { |
@@ -65,7 +65,7 @@ abstract class SourceSpanMixin implements SourceSpan { |
return buffer.toString(); |
} |
- bool operator ==(SourceSpan other) => |
+ bool operator ==(other) => other is SourceSpan && |
start == other.start && end == other.end; |
int get hashCode => start.hashCode + (31 * end.hashCode); |