Module: nagvis
Branch: master
Commit: 72e4b1a5cfabab7557849ac48eec288ee14dccb3
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=72e4b1a5cfabab7557849ac48eec288ee14dccb3

Author: Lars Michelsen <[email protected]>
Date:   Sun Oct 31 00:54:51 2010 +0200

Fixed regex cache

---

 share/frontend/nagvis-js/js/nagvis.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/share/frontend/nagvis-js/js/nagvis.js 
b/share/frontend/nagvis-js/js/nagvis.js
index 8773e05..a5b7191 100644
--- a/share/frontend/nagvis-js/js/nagvis.js
+++ b/share/frontend/nagvis-js/js/nagvis.js
@@ -1012,8 +1012,11 @@ function getRegEx(n, exp, mod) {
        if(typeof(regexCache[n]) !== 'undefined')
                return regexCache[n];
        else
-               if(typeof mod !== 'undefined')
-                       return regex = new RegExp(exp, mod);
-               else
-                       return regex = new RegExp(exp);
+               if(typeof mod !== 'undefined') {
+                       regexCache[n+'-'+mod] = new RegExp(exp, mod);
+                       return regexCache[n+'-'+mod];
+               } else {
+                       regexCache[n] = new RegExp(exp);
+                       return regexCache[n];
+               }
 }


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to