1
0
Fork 0
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:
nex3 2007-05-08 07:44:22 +00:00
parent 5a5caf6ed3
commit 8509286ad2

View file

@ -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>