mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
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
1 changed files with 4 additions and 1 deletions
|
@ -165,10 +165,13 @@ module Haml
|
|||
|
||||
private
|
||||
|
||||
@@tab_cache = {}
|
||||
# Gets <tt>count</tt> tabs. Mostly for internal use.
|
||||
def tabs(count)
|
||||
@real_tabs = count
|
||||
' ' * (count + @tabulation)
|
||||
tabs = count + @tabulation
|
||||
' ' * tabs
|
||||
@@tab_cache[tabs] ||= ' ' * tabs
|
||||
end
|
||||
|
||||
# Iterates through the classes and ids supplied through <tt>.</tt>
|
||||
|
|
Loading…
Add table
Reference in a new issue