Caching tabs in Haml::Buffer is good.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@508 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
5a5caf6ed3
commit
8509286ad2
|
@ -165,10 +165,13 @@ module Haml
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@@tab_cache = {}
|
||||||
# Gets <tt>count</tt> tabs. Mostly for internal use.
|
# Gets <tt>count</tt> tabs. Mostly for internal use.
|
||||||
def tabs(count)
|
def tabs(count)
|
||||||
@real_tabs = count
|
@real_tabs = count
|
||||||
' ' * (count + @tabulation)
|
tabs = count + @tabulation
|
||||||
|
' ' * tabs
|
||||||
|
@@tab_cache[tabs] ||= ' ' * tabs
|
||||||
end
|
end
|
||||||
|
|
||||||
# Iterates through the classes and ids supplied through <tt>.</tt>
|
# Iterates through the classes and ids supplied through <tt>.</tt>
|
||||||
|
|
Loading…
Reference in New Issue