Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a134122

Browse files
committed
perf($parse): trim expression only if string
1 parent 99d70af commit a134122

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ng/parse.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -995,11 +995,12 @@ function $ParseProvider() {
995995
$parseOptions.csp = $sniffer.csp;
996996

997997
return function(exp, interceptorFn) {
998-
var parsedExpression, oneTime,
999-
cacheKey = (exp = trim(exp));
998+
var parsedExpression, oneTime, cacheKey;
1000999

10011000
switch (typeof exp) {
10021001
case 'string':
1002+
cacheKey = exp = exp.trim();
1003+
10031004
if (cache.hasOwnProperty(cacheKey)) {
10041005
parsedExpression = cache[cacheKey];
10051006
} else {

0 commit comments

Comments
 (0)