f2431602 by Patrick Gibson

Re-use the Regexp object from @bindingRegExp() instead of creating a new one for…

… each iteration; remove the unused dataRegExp variable.
1 parent 6921e783
......@@ -51,11 +51,12 @@ class Rivets.View
build: =>
@bindings = []
bindingRegExp = @bindingRegExp()
for node in @el.getElementsByTagName '*'
for attribute in node.attributes
dataRegExp = new RegExp(@data, 'g')
if @bindingRegExp().test attribute.name
type = attribute.name.replace @bindingRegExp(), ''
if bindingRegExp.test attribute.name
type = attribute.name.replace bindingRegExp, ''
pipes = attribute.value.split('|').map (pipe) -> pipe.trim()
path = pipes.shift().split '.'
context = @contexts[path.shift()]
......