Skip to content

Commit

Permalink
Eliminate duplicate property lookup in Bucket.add*Vertex
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wojciechowski committed Oct 27, 2015
1 parent bfdeef9 commit 1198196
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/data/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ function createVertexAddMethod(shaderName, shader) {
}

var body = '';
body += 'var elementGroups = this.elementGroups.' + shaderName + ';\n';
body += 'elementGroups.current.vertexLength++;\n';
body += 'return this.buffers.' + shader.vertexBuffer + '.push(\n ' + pushArgs.join(',\n ') + '\n) - elementGroups.current.vertexStartIndex;';
body += 'var elementGroup = this.elementGroups.' + shaderName + '.current;\n';
body += 'elementGroup.vertexLength++;\n';
body += 'return this.buffers.' + shader.vertexBuffer + '.push(\n ' + pushArgs.join(',\n ') + '\n) - elementGroup.vertexStartIndex;';

return new Function(shader.attributeArgs, body);
}
Expand Down

0 comments on commit 1198196

Please sign in to comment.