aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-18 16:11:27 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-18 16:11:27 -0700
commit541ed2b60db2be78e8a0ce763af73a3cc28da4db (patch)
tree88a2cf8b175c6273c8f0faaa8cab27e7e2c8ec5a /actionpack
parenta75d21df06d0b7af21921aad38b021056aa15e63 (diff)
downloadrails-541ed2b60db2be78e8a0ce763af73a3cc28da4db.tar.gz
rails-541ed2b60db2be78e8a0ce763af73a3cc28da4db.tar.bz2
rails-541ed2b60db2be78e8a0ce763af73a3cc28da4db.zip
avoid a few comparisons
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index e53076c586..7c877a0f57 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -342,10 +342,10 @@ module ActionView
values.unshift(first_value)
cycle = get_cycle(name)
- if (cycle.nil? || cycle.values != values)
+ unless cycle && cycle.values == values
cycle = set_cycle(name, Cycle.new(*values))
end
- return cycle.to_s
+ cycle.to_s
end
# Returns the current cycle string after a cycle has been started. Useful
@@ -386,7 +386,7 @@ module ActionView
# </table>
def reset_cycle(name = "default")
cycle = get_cycle(name)
- cycle.reset unless cycle.nil?
+ cycle.reset if cycle
end
class Cycle #:nodoc: