aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryFavoriteManager.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-03-09 00:00:43 +0100
committerMax <post@wickenrode.com>2015-03-09 00:00:43 +0100
commit784876380b871b6d85978a705e2477e7b7d2d984 (patch)
tree5705e92b0aab9fecdf7d37954f5a0c3e873de1ff /Source/SPQueryFavoriteManager.m
parentb15c7fb2d407ec8751a2579a7a68bbd8a037ccfe (diff)
downloadsequelpro-784876380b871b6d85978a705e2477e7b7d2d984.tar.gz
sequelpro-784876380b871b6d85978a705e2477e7b7d2d984.tar.bz2
sequelpro-784876380b871b6d85978a705e2477e7b7d2d984.zip
Minimal refactoring
Replaced some (range.location + range.length) with NSMaxRange(range)
Diffstat (limited to 'Source/SPQueryFavoriteManager.m')
-rw-r--r--Source/SPQueryFavoriteManager.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 6522b884..a715bd93 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -413,7 +413,7 @@
// Check whether the selection range lies within the snippet
if (selRange.location != NSNotFound
&& selRange.location > matchedRange.location + 1
- && selRange.location + selRange.length < matchedRange.location + matchedRange.length)
+ && NSMaxRange(selRange) < NSMaxRange(matchedRange))
{
selectionInsideSnippet = YES;
}
@@ -423,7 +423,7 @@
NSInteger snippetNumber = [[queryString substringWithRange:snippetNumberRange] integerValue];
[snippetNumbers setObject:@YES forKey:[NSNumber numberWithInteger:snippetNumber]];
- rangeStart = matchedRange.location + matchedRange.length;
+ rangeStart = NSMaxRange(matchedRange);
}
// If the selection is not inside a snippet, wrap it inside the snippet syntax.