Simplify LocationTracking#rightmost?
authorGreg Hurrell <greg@hurrell.net>
Mon, 20 Oct 2014 14:55:58 +0000 (07:55 -0700)
committerGreg Hurrell <greg@hurrell.net>
Mon, 20 Oct 2014 15:12:42 +0000 (08:12 -0700)
- drop unnecessary explicit `self` receivers
- merge final two conditional clauses into one

lib/walrat/location_tracking.rb

index e6fa4e0d7f132eec419287db10869a45bda45259..8c8fcd4c509536386740cf190a956376e656d697 100755 (executable)
@@ -93,14 +93,12 @@ module Walrat
     # true if the receiver is rightmost or equal.
     # If the other object is farther to the right returns false.
     def rightmost? other
-      if self.line_end > other.line_end
+      if line_end > other.line_end
         true
-      elsif other.line_end > self.line_end
+      elsif other.line_end > line_end
         false
-      elsif self.column_end >= other.column_end
-        true
       else
-        false
+        column_end >= other.column_end
       end
     end
   end # module LocationTracking