1fda314c by Michael Richards

Merge pull request #12 from wrapp/feature/peformance-tweaks

Peformance tweaks
2 parents f068c59b df0996e3
...@@ -60,11 +60,12 @@ class Rivets.View ...@@ -60,11 +60,12 @@ class Rivets.View
60 # Builds the Rivets.Binding instances for the view. 60 # Builds the Rivets.Binding instances for the view.
61 build: => 61 build: =>
62 @bindings = [] 62 @bindings = []
63 bindingRegExp = @bindingRegExp()
63 64
64 for node in @el.getElementsByTagName '*' 65 for node in @el.getElementsByTagName '*'
65 for attribute in node.attributes 66 for attribute in node.attributes
66 if @bindingRegExp().test attribute.name 67 if bindingRegExp.test attribute.name
67 type = attribute.name.replace @bindingRegExp(), '' 68 type = attribute.name.replace bindingRegExp, ''
68 pipes = attribute.value.split('|').map (pipe) -> pipe.trim() 69 pipes = attribute.value.split('|').map (pipe) -> pipe.trim()
69 path = pipes.shift().split '.' 70 path = pipes.shift().split '.'
70 model = @models[path.shift()] 71 model = @models[path.shift()]
......