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:
parent
3fcea7fb05
commit
88343b9858
1 changed files with 2 additions and 2 deletions
|
@ -183,12 +183,12 @@ class AwesomePrint
|
|||
|
||||
#------------------------------------------------------------------------------
|
||||
def indent
|
||||
' ' * @indentation
|
||||
@indent ||= ' ' * @indentation
|
||||
end
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
def outdent
|
||||
' ' * (@indentation - @options[:indent])
|
||||
@outdent ||= ' ' * (@indentation - @options[:indent])
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue