Changeset 4817
- Timestamp:
- 08/25/06 06:01:02 (2 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/ordered_options.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r4787 r4817 1 1 *SVN* 2 3 * Use Array#assoc in ActiveSupport::OrderedHash. [Mauricio Fernandez] 2 4 3 5 * Greatly increased performance of String.to_json, which speeds up RJS considerably on large pages, fixes #3473 [Shugo Maeda] trunk/activesupport/lib/active_support/ordered_options.rb
r4411 r4817 3 3 class OrderedHash < Array #:nodoc: 4 4 def []=(key, value) 5 if pair = find_pair(key)5 if pair = assoc(key) 6 6 pair.pop 7 7 pair << value … … 12 12 13 13 def [](key) 14 pair = find_pair(key)14 pair = assoc(key) 15 15 pair ? pair.last : nil 16 16 end … … 23 23 collect { |key, value| value } 24 24 end 25 26 private27 def find_pair(key)28 self.each { |i| return i if i.first == key }29 return false30 end31 25 end 32 26 end