1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

memoize indent/outdent since they never change for life of object (@indentation is set in initialize)

(cherry picked from commit a6988607092c52da14342270242eaf2578f4b130)
This commit is contained in:
John Dell 2010-04-03 16:55:45 -07:00 committed by Mike Dvorkin
parent 3fcea7fb05
commit 88343b9858

View file

@ -183,12 +183,12 @@ class AwesomePrint
#------------------------------------------------------------------------------
def indent
' ' * @indentation
@indent ||= ' ' * @indentation
end
#------------------------------------------------------------------------------
def outdent
' ' * (@indentation - @options[:indent])
@outdent ||= ' ' * (@indentation - @options[:indent])
end
end