From ecba29a08a83a47ee6fa8c0263beb6fd685f90ad Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 10 Jul 2015 17:14:22 +0300 Subject: [PATCH] Reword contract of Collection's removeAll and retainAll to emphasize that the criteria to remove or retain element is the containment in the specified collection. Collection.remove(element): clarify docs. --- core/builtins/native/kotlin/Collections.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/builtins/native/kotlin/Collections.kt b/core/builtins/native/kotlin/Collections.kt index 884cb0a2ad8..43516037603 100644 --- a/core/builtins/native/kotlin/Collections.kt +++ b/core/builtins/native/kotlin/Collections.kt @@ -86,7 +86,8 @@ public interface MutableCollection : Collection, MutableIterable { public fun add(e: E): Boolean /** - * Removes the specified element from the collection. + * Removes a single instance of the specified element from this + * collection, if it is present. * * @return `true` if the element has been successfully removed; `false` if it was not present in the collection. */ @@ -101,14 +102,14 @@ public interface MutableCollection : Collection, MutableIterable { public fun addAll(c: Collection): Boolean /** - * Removes all of the elements in the specified collection from this collection. + * Removes all of this collection's elements that are also contained in the specified collection. * * @return `true` if any of the specified elements was removed from the collection, `false` if the collection was not modified. */ public fun removeAll(c: Collection): Boolean /** - * Removes all of the elements not contained in the specified collection from this collection. + * Retains only the elements in this collection that are contained in the specified collection. * * @return `true` if any element was removed from the collection, `false` if the collection was not modified. */