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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/SourceRangeUtils.java

Issue 10828169: 'Split && condition' quick assist. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/SourceRangeUtils.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/SourceRangeUtils.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/SourceRangeUtils.java
index bab26267e0e572a141e69bf31f5305199313521a..b5c97c0dcae9d85ef9996fd8e4313344d1d5279a 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/SourceRangeUtils.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/SourceRangeUtils.java
@@ -53,8 +53,13 @@ public class SourceRangeUtils {
* @return <code>true</code> if two given {@link SourceRange}s are intersecting.
*/
public static boolean intersects(SourceRange a, SourceRange b) {
- return contains(a, b.getOffset()) || contains(a, b.getOffset() + b.getLength() - 1)
- || contains(b, a.getOffset());
+ if (getEnd(a) <= b.getOffset()) {
+ return false;
+ }
+ if (a.getOffset() >= getEnd(b)) {
+ return false;
+ }
+ return true;
}
/**

Powered by Google App Engine
This is Rietveld 408576698