Merge pull request #12 from wrapp/feature/peformance-tweaks
Peformance tweaks
Showing
1 changed file
with
3 additions
and
2 deletions
... | @@ -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()] | ... | ... |
-
Please register or sign in to post a comment