equal
deleted
inserted
replaced
1031 private boolean shouldOptimizeChange(int firstRow, int lastRow) { |
1031 private boolean shouldOptimizeChange(int firstRow, int lastRow) { |
1032 if (!isTransformed()) { |
1032 if (!isTransformed()) { |
1033 // Not transformed, nothing to do. |
1033 // Not transformed, nothing to do. |
1034 return false; |
1034 return false; |
1035 } |
1035 } |
1036 if (!sorted || (lastRow - firstRow) > viewToModel.length / 10) { |
1036 if (!sorted || viewToModel.length == 0 || |
1037 // We either weren't sorted, or to much changed, sort it all |
1037 (lastRow - firstRow) > viewToModel.length / 10) { |
|
1038 // We either weren't sorted, or to much changed, sort it all or |
|
1039 // this is the first row added and we have to update diffeent caches |
1038 sort(); |
1040 sort(); |
1039 return false; |
1041 return false; |
1040 } |
1042 } |
1041 return true; |
1043 return true; |
1042 } |
1044 } |