mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-23 20:59:58 +00:00
GP-4221 - Fixed timing exception related to selecting table items before
the table has been sorted
This commit is contained in:
parent
e17a03e2d1
commit
ed1df869e3
@ -139,7 +139,7 @@ public class TableData<ROW_OBJECT> implements Iterable<ROW_OBJECT> {
|
||||
* @return the index
|
||||
*/
|
||||
public int indexOf(ROW_OBJECT t) {
|
||||
if (!sortContext.isUnsorted()) {
|
||||
if (isSorted()) {
|
||||
Comparator<ROW_OBJECT> comparator = sortContext.getComparator();
|
||||
return Collections.binarySearch(data, t, comparator);
|
||||
}
|
||||
@ -159,7 +159,7 @@ public class TableData<ROW_OBJECT> implements Iterable<ROW_OBJECT> {
|
||||
source.remove(t);
|
||||
}
|
||||
|
||||
if (sortContext.isUnsorted()) {
|
||||
if (!isSorted()) {
|
||||
return data.remove(t); // no sort; cannot binary search
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user