public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/JackDanger/rails.git
Search Repo:
Precompute TimeZone.us_zones [#199 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Martin Eisenhardt (author)
Thu May 15 07:21:43 -0700 2008
josh (committer)
Thu May 15 07:22:44 -0700 2008
commit  fc02eabf296d6edb74a95174c7322293a54c9492
tree    d331bf73859ca4f5236e46dd13d6115506c85719
parent  802034ff5f1c3e3b576b664d5660e76c8f44909d
...
325
326
327
 
 
 
328
329
330
331
...
361
362
363
364
365
366
367
368
369
370
371
 
372
373
374
...
325
326
327
328
329
330
331
332
333
334
...
364
365
366
 
 
 
 
367
368
369
 
370
371
372
373
0
@@ -325,6 +325,9 @@
0
     ZONES.sort!
0
     ZONES.freeze
0
     ZONES_MAP.freeze
0
+
0
+ US_ZONES = ZONES.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }
0
+ US_ZONES.freeze
0
   end
0
 
0
   class << self
0
0
@@ -361,14 +364,10 @@
0
       end
0
     end
0
 
0
- # A regular expression that matches the names of all time zones in
0
- # the USA.
0
- US_ZONES = /US|Arizona|Indiana|Hawaii|Alaska/.freeze
0
-
0
     # A convenience method for returning a collection of TimeZone objects
0
     # for time zones in the USA.
0
     def us_zones
0
- all.find_all { |z| z.name =~ US_ZONES }
0
+ US_ZONES
0
     end
0
   end
0
 end

Comments

    No one has commented yet.