gitlab #679
Change-Id: I4c297a9a3ed258e16b2cd3663b63115748c6ae61
* Remove elements that appear more than once. Keep order otherwise.
* @param list to be pruned
*/
* Remove elements that appear more than once. Keep order otherwise.
* @param list to be pruned
*/
- public static void unique(List<?> list) {
- int c = list.size();
- int i = c-1;
+ public static void unique(List<?> list) {
+ int i = list.size()-1;
while (i>0) {
Object o = list.get(i);
int index = list.indexOf(o);
while (i>0) {
Object o = list.get(i);
int index = list.indexOf(o);
+ if (index>=0 && index < i) {