Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Can this be more efficient?

#2

Seems like the answer is yes:


  # Initializes config. Default config values
  # are overridden as specified by overrides.
  def initialize_config(overrides={})
    delegates = self.class.configurations

    # note the defaults could be stored first and overridden
    # by the overrides, but this is likely more efficient
    # on average since delegates duplicate default values.
    store = {}
    overrides.each_pair do |key, value|
      store[key] = value
    end
    delegates.each_pair do |key, delegate|
      store[key] = delegate.default unless store.has_key?(key)
    end

    @config = DelegateHash.new(delegates, store).bind(self)
  end

Reported by bahuvrihi · December 8th, 2008 @ 03:25 PM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. bahuvrihi
    bahuvrihi
    • State changed from new to resolved

    March 26th, 2009 @ 07:41 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.