Breaking change. Map operations revisited.
This commit is contained in:
@@ -205,21 +205,6 @@ fun filtering(): List<GenericFunction> {
|
||||
return FilteringStream(this, true, predicate)
|
||||
"""
|
||||
}
|
||||
|
||||
include(Maps)
|
||||
doc(Maps) { "Returns a map containing all key-value pairs matching the given *predicate*" }
|
||||
returns(Maps) { "Map<K, V>" }
|
||||
body(Maps) {
|
||||
"""
|
||||
val result = HashMap<K,V>()
|
||||
for (entry in this) {
|
||||
if (predicate(entry)) {
|
||||
result.put(entry.key, entry.value)
|
||||
}
|
||||
}
|
||||
return result
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
templates add f("filterTo(destination: C, predicate: (T) -> Boolean)") {
|
||||
@@ -246,8 +231,6 @@ fun filtering(): List<GenericFunction> {
|
||||
return destination
|
||||
"""
|
||||
}
|
||||
|
||||
include(Maps)
|
||||
}
|
||||
|
||||
templates add f("filterNot(predicate: (T) -> Boolean)") {
|
||||
@@ -276,7 +259,6 @@ fun filtering(): List<GenericFunction> {
|
||||
return FilteringStream(this, false, predicate)
|
||||
"""
|
||||
}
|
||||
include(Maps)
|
||||
}
|
||||
|
||||
templates add f("filterNotTo(destination: C, predicate: (T) -> Boolean)") {
|
||||
@@ -300,7 +282,6 @@ fun filtering(): List<GenericFunction> {
|
||||
return destination
|
||||
"""
|
||||
}
|
||||
include(Maps)
|
||||
}
|
||||
|
||||
templates add f("filterNotNull()") {
|
||||
|
||||
Reference in New Issue
Block a user