Timeline for Return true if the elements of an array do not contain one or the other
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 15, 2015 at 7:23 | history | edited | maaartinus | CC BY-SA 3.0 | added 670 characters in body |
| Apr 14, 2015 at 17:48 | comment | added | maaartinus | @rolfl Edited. There's a single unboxing inside the call to contains, that's all. | |
| Apr 14, 2015 at 17:44 | history | edited | maaartinus | CC BY-SA 3.0 | added 462 characters in body |
| Apr 14, 2015 at 17:23 | comment | added | rolfl | Hmm, it is still not good, not as bad as I thought, but the instance overhead, and autoboxing additions put neat code in front of an ugly backend. I see that you do recommend an early-exit on finding both, hat suggestion is the most valuable part as far as I can tell. Unfortunately my down-vote is locked in until your post is edited... | |
| Apr 14, 2015 at 17:11 | comment | added | maaartinus | @rolfl Why not? It's not an ArrayList. See the doc. It's less efficient than looping manually, but only by a small constant; the contains method is full speed. | |
| Apr 14, 2015 at 17:06 | comment | added | rolfl | Really? You're going to convert the int[] array to a List<Integer>? | |
| Apr 14, 2015 at 12:08 | vote | accept | alanbuchanan | ||
| Apr 14, 2015 at 12:01 | history | answered | maaartinus | CC BY-SA 3.0 |