This project is archived and is in readonly mode.

#1044 ✓resolved
mattcoz

Slick is not caching parsed expressions

Reported by mattcoz | October 17th, 2010 @ 05:36 AM | in 1.3.1 (closed)

Slick has a cache for parsing results but it is not currently being populated correctly. Here is the problem:

while (expression != (expression = expression.replace(regexp, parser)));
parsed.length = parsed.expressions.length;
return currentCache[expression] = (reversed) ? reverse(parsed) : parsed;

The expression variable will always be a blank string after the regexp is run on it.

Here is my proposed fix:

var cacheEntry = currentCache[expression] = null;
while (expression != (expression = expression.replace(regexp, parser)));
parsed.length = parsed.expressions.length;
return cacheEntry = (reversed) ? reverse(parsed) : parsed;

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Tags

Pages