Gitlab service upgraded. Please report any problems to dl_gitadmin@cs.lth.se

Commit 7fd2e88c authored by Noric Couderc's avatar Noric Couderc

Removed conditional in runRemove()

Collection.remove() has two signatures, a toss-coin used to decide which one to
pick. Instead we use a method runRemove2 that runs the remove method, making the
conditional unnecessary.
parent 41b379c5
......@@ -47,11 +47,7 @@ public class CollectionApplication<T extends Collection> extends Application<T>
public void runRemove() {
if (dataStructure.isEmpty()) { return; }
if (randomGenerator.nextBoolean()) {
dataStructure.remove(generateIndex());
} else {
dataStructure.remove((Object) randomGenerator.nextInt());
}
dataStructure.remove((Object) randomGenerator.nextInt());
}
public void runRemoveAll() { dataStructure.removeAll(argument); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment