Skip to content

Commit

Permalink
memoize indent/outdent since they never change for life of object (@I…
Browse files Browse the repository at this point in the history
…ndentation is set in initialize)

(cherry picked from commit a6988607092c52da14342270242eaf2578f4b130)
  • Loading branch information
John Dell authored and Mike Dvorkin committed Apr 4, 2010
1 parent 3fcea7f commit 88343b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ap/awesome_print.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ def indented

#------------------------------------------------------------------------------
def indent
' ' * @indentation
@indent ||= ' ' * @indentation
end

#------------------------------------------------------------------------------
def outdent
' ' * (@indentation - @options[:indent])
@outdent ||= ' ' * (@indentation - @options[:indent])
end

end

0 comments on commit 88343b9

Please sign in to comment.