Renamed Iterable.contains to containsItem, to avoid puzzling.

Otherwise, you could accidentally look for Double in List<Int>, or even for Int in ShortSequence (by stupid iterating).
This commit is contained in:
Evgeny Gerashchenko
2013-01-29 20:35:16 +04:00
parent 2fd1430329
commit 63484e28e0
@@ -77,7 +77,7 @@ public fun <T> Iterable<T>.last() : T {
* If collection implements [[java.util.AbstractCollection]] an overridden implementation of the contains
* method will be used.
*/
public fun <T> Iterable<T>.contains(item : T) : Boolean {
public fun <T> Iterable<T>.containsItem(item : T) : Boolean {
if (this is java.util.AbstractCollection<T>) {
return this.contains(item);
}