From b9e9407ffb896192cd4ed115048bb3f9f110bd2b Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Fri, 4 Jan 2013 18:27:36 +0100 Subject: [PATCH] $.tablesorter: remove and inline getTextFromRowAndCellIndex() It introduced unnecessary indirection and was only called once. Change-Id: I519cc1f04a581d41aa23229182c55466ed7757c8 --- resources/jquery/jquery.tablesorter.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/resources/jquery/jquery.tablesorter.js b/resources/jquery/jquery.tablesorter.js index 8320304ff1..e252ba549c 100644 --- a/resources/jquery/jquery.tablesorter.js +++ b/resources/jquery/jquery.tablesorter.js @@ -113,14 +113,6 @@ } } - function getTextFromRowAndCellIndex( rows, rowIndex, cellIndex ) { - if ( rows[rowIndex] && rows[rowIndex].cells[cellIndex] ) { - return $.trim( getElementSortKey( rows[rowIndex].cells[cellIndex] ) ); - } else { - return ''; - } - } - function detectParserForColumn( table, rows, cellIndex ) { var l = parsers.length, nodeValue, @@ -130,8 +122,13 @@ concurrent = 0, needed = ( rows.length > 4 ) ? 5 : rows.length; - while( i < l ) { - nodeValue = getTextFromRowAndCellIndex( rows, rowIndex, cellIndex ); + while ( i < l ) { + if ( rows[rowIndex] && rows[rowIndex].cells[cellIndex] ) { + nodeValue = $.trim( getElementSortKey( rows[rowIndex].cells[cellIndex] ) ); + } else { + nodeValue = ''; + } + if ( nodeValue !== '') { if ( parsers[i].is( nodeValue, table ) ) { concurrent++; -- 2.20.1