From 3c6bf82115e184f9c819e5797d3822b6b9daeb14 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Mon, 9 Feb 2009 23:12:47 -0600 Subject: TimeWithZone#advance: leverage Hash#values_at and non-block form of #any? for a little less line noise, and a slight speedup (thanks raggi and Roman2K) --- activesupport/lib/active_support/time_with_zone.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/time_with_zone.rb') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index e9e536c267..518ca7742f 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -230,7 +230,7 @@ module ActiveSupport def advance(options) # If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time, # otherwise advance from #utc, for accuracy when moving across DST boundaries - if options.any? {|k,v| [:years, :weeks, :months, :days].include? k} + if options.values_at(:years, :weeks, :months, :days).any? method_missing(:advance, options) else utc.advance(options).in_time_zone(time_zone) -- cgit v1.2.3