1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Modified: The 'i' counter that was in the sort loop was outside the function scope, so the JS engine would need to go back up a level in its scope chain. Not a big thing, but any speed in the sorting function is welcome

This commit is contained in:
Allan Jardine 2011-11-18 16:01:43 +00:00
parent 4c48650a25
commit 967e1419c1

View File

@ -4707,12 +4707,12 @@
*/
var iSortLen = aaSort.length;
oSettings.aiDisplayMaster.sort( function ( a, b ) {
var iTest, iDataSort, sDataType;
for ( i=0 ; i<iSortLen ; i++ )
var k, iTest, iDataSort, sDataType;
for ( k=0 ; k<iSortLen ; k++ )
{
iDataSort = aoColumns[ aaSort[i][0] ].iDataSort;
iDataSort = aoColumns[ aaSort[k][0] ].iDataSort;
sDataType = aoColumns[ iDataSort ].sType;
iTest = oSort[ (sDataType?sDataType:'string')+"-"+aaSort[i][1] ](
iTest = oSort[ (sDataType?sDataType:'string')+"-"+aaSort[k][1] ](
_fnGetCellData( oSettings, a, iDataSort, 'sort' ),
_fnGetCellData( oSettings, b, iDataSort, 'sort' )
);