Permalink
Browse files

Improve an ugly line of code.

  • Loading branch information...
1 parent 93ac35f commit 6803d955bf9dfee4f166af7c4cbb7648ca7ec6ec @Manfred committed Apr 18, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/shl.rb
View
4 lib/shl.rb
@@ -8,9 +8,7 @@ def initialize(a)
a.each{|k,v|self[k]=v}
end
def []=(k,v)
- @_o||=[]
- @_o<<k
- super
+ (@_o||=[])<<k;super
end
def each(&block)
@_o.each{|k|block.call(k,self[k])}

0 comments on commit 6803d95

Please sign in to comment.