Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit ebd325d

Browse files
committed
chore(benchmark): remove interpolateHtml method
1 parent 13e87e0 commit ebd325d

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

benchmark/web/bp.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ bp.resetIterations = function() {
5050
bp.runState.iterations = 0;
5151
};
5252

53-
bp.interpolateHtml = function(string, list) {
54-
list.forEach(function(item, i) {
55-
var exp = new RegExp('%' + i, ['g']);
56-
string = string.replace(exp, item);
57-
});
58-
return string;
59-
}
60-
6153
bp.numMilliseconds = function() {
6254
if (window.performance != null && typeof window.performance.now == 'function') {
6355
return window.performance.now();
@@ -310,7 +302,7 @@ bp.addLinks = function() {
310302
// Add new benchmark suites here
311303
['tree.html', 'TreeComponent']
312304
].forEach((function (link) {
313-
linkHtml += bp.interpolateHtml('<a href=%0>%1</a>', link);
305+
linkHtml += '<a href="'+ link[0] +'">'+ link[1] +'</a>';
314306
}));
315307

316308
linkDiv.innerHTML = linkHtml;

benchmark/web/bp.spec.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,6 @@ describe('bp', function() {
262262
});
263263

264264

265-
describe('.interpolateHtml', function() {
266-
it('should render a list of values into a string', function() {
267-
expect(bp.interpolateHtml('<div>%0</div><a>%1</a>', ['Hello', 'Jeff'])).
268-
toBe('<div>Hello</div><a>Jeff</a>');
269-
});
270-
271-
272-
it('should replace multiple instances of a token', function() {
273-
expect(bp.interpolateHtml('<div>%0</div><a>%0</a>', ['Hello'])).
274-
toBe('<div>Hello</div><a>Hello</a>');
275-
});
276-
});
277-
278-
279265
describe('.setIterations()', function() {
280266
it('should set provided arguments to runState object', function() {
281267
bp.runState = {numSamples: 20};

0 commit comments

Comments
 (0)