Skip to content

Commit

Permalink
Improve an ugly line of code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Manfred committed Apr 18, 2012
1 parent 93ac35f commit 6803d95
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/shl.rb
Expand Up @@ -8,9 +8,7 @@ def initialize(a)
a.each{|k,v|self[k]=v} a.each{|k,v|self[k]=v}
end end
def []=(k,v) def []=(k,v)
@_o||=[] (@_o||=[])<<k;super
@_o<<k
super
end end
def each(&block) def each(&block)
@_o.each{|k|block.call(k,self[k])} @_o.each{|k|block.call(k,self[k])}
Expand Down

0 comments on commit 6803d95

Please sign in to comment.