- Make some regexp faster

release-0.6
alecpl 14 years ago
parent 040d2296c4
commit bbd4ca89ef

@ -101,7 +101,7 @@ init: function()
init_row: function(row) init_row: function(row)
{ {
// make references in internal array and set event handlers // make references in internal array and set event handlers
if (row && String(row.id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i)) { if (row && String(row.id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i)) {
var self = this, var self = this,
uid = RegExp.$1; uid = RegExp.$1;
row.uid = uid; row.uid = uid;
@ -601,7 +601,7 @@ get_first_row: function()
var i, len, rows = this.list.tBodies[0].rows; var i, len, rows = this.list.tBodies[0].rows;
for (i=0, len=rows.length-1; i<len; i++) for (i=0, len=rows.length-1; i<len; i++)
if (rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) if (rows[i].id && String(rows[i].id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null)
return RegExp.$1; return RegExp.$1;
} }
@ -614,7 +614,7 @@ get_last_row: function()
var i, rows = this.list.tBodies[0].rows; var i, rows = this.list.tBodies[0].rows;
for (i=rows.length-1; i>=0; i--) for (i=rows.length-1; i>=0; i--)
if (rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) if (rows[i].id && String(rows[i].id).match(/^rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null)
return RegExp.$1; return RegExp.$1;
} }

Loading…
Cancel
Save