It introduced unnecessary indirection and was only called once.
Change-Id: I519cc1f04a581d41aa23229182c55466ed7757c8
- 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,
function detectParserForColumn( table, rows, cellIndex ) {
var l = parsers.length,
nodeValue,
concurrent = 0,
needed = ( rows.length > 4 ) ? 5 : rows.length;
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++;
if ( nodeValue !== '') {
if ( parsers[i].is( nodeValue, table ) ) {
concurrent++;