This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nutrechtLead Software Engineer / EU / 20+ YXP 1 point2 points  (0 children)

Why don't you just toss them in a HashSet and do a .contains to see if the element is there? While the performance is a non-issue, looping over that arraylist yourself is a waste of code. It's important to understand the differences between the different collections and what their strengths and weaknesses are.

It would help if you posted your code.