不要怂,就是干,撸起袖子干!

Commit c17b265a by Dr. Evil

Use of String#substring instead of String#slice

Benchmarks show that using substring is faster than slice
1 parent ff693b29
Showing with 1 additions and 1 deletions
...@@ -34,7 +34,7 @@ module.exports = { ...@@ -34,7 +34,7 @@ module.exports = {
AttributeType = AttributeType || ''; // if attribute is not defined, assign empty string in order to prevent AttributeType = AttributeType || ''; // if attribute is not defined, assign empty string in order to prevent
// AttributeType.toString() to fail with uncaught exception later in the code // AttributeType.toString() to fail with uncaught exception later in the code
var result = value var result = value
.slice(1, -1) .substring(1, value.length - 1)
.split(',', 2); .split(',', 2);
if (result.length !== 2) return value; if (result.length !== 2) return value;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!