()
| 575 | items = __ctx.t.children(__ctx.i), |
| 576 | s = 0, e = items.length - 1, i, |
| 577 | linearSearch = function() { |
| 578 | while (e >= s) { |
| 579 | i = items[s]; |
| 580 | let d = __ctx.t.itemData(i); |
| 581 | if (d._type === 'column') { |
| 582 | if (pgAdmin.numeric_comparator(d._id, _data._id) == 1) |
| 583 | return true; |
| 584 | } else if (pgAdmin.natural_sort(d._label, _data._label) == 1) |
| 585 | return true; |
| 586 | s++; |
| 587 | } |
| 588 | //when the current element is greater than the end element |
| 589 | if (e != items.length - 1) { |
| 590 | i = items[e+1]; |
| 591 | return true; |
| 592 | } |
| 593 | i = null; |
| 594 | return false; |
| 595 | }, |
| 596 | binarySearch = function() { |
| 597 | let d, m; |
| 598 | // Binary search only outperforms Linear search for n > 44. |
no test coverage detected