Permalink
Browse files

cut out map fuzz to speed up build time

  • Loading branch information...
1 parent c08e0c9 commit d6b15fa49218c40f2c5dedd341c5f6db84a0858d @josh josh committed Dec 23, 2009
Showing with 0 additions and 41 deletions.
  1. +0 −41 lib/rack/mount/multimap.rb
View
41 lib/rack/mount/multimap.rb
@@ -7,22 +7,6 @@
module Rack::Mount
class Multimap < NestedMultimap #:nodoc:
- def self.[](*args)
- map = super
- map.instance_variable_set('@fuzz', {})
- map
- end
-
- def initialize(default = [])
- @fuzz = {}
- super
- end
-
- def initialize_copy(original)
- @fuzz = original.instance_variable_get('@fuzz').dup
- super
- end
-
def store(*args)
keys = args.dup
value = keys.pop
@@ -35,7 +19,6 @@ def store(*args)
end
if key.is_a?(Regexp)
- @fuzz[value] = key
if keys.empty?
@hash.each_pair { |k, l| l << value if k =~ key }
self.default << value
@@ -56,12 +39,6 @@ def store(*args)
end
alias_method :[]=, :store
- def freeze
- @fuzz.clear
- @fuzz = nil
- super
- end
-
undef :index, :invert
def height
@@ -72,23 +49,5 @@ def average_height
lengths = containers_with_default.map { |e| e.length }
lengths.inject(0) { |sum, len| sum += len }.to_f / lengths.size
end
-
- protected
- def update_container(key) #:nodoc:
- super do |container|
- if container.is_a?(self.class)
- container.each_container_with_default do |c|
- c.delete_if do |value|
- (requirement = @fuzz[value]) && key !~ requirement
- end
- end
- else
- container.delete_if do |value|
- (requirement = @fuzz[value]) && key !~ requirement
- end
- end
- yield container
- end
- end
end
end

0 comments on commit d6b15fa

Please sign in to comment.