nested loop removed
parent
5b86c403b0
commit
6cda430cdd
|
@ -15,9 +15,6 @@ val Context.bookmarkStorage: PlacesBookmarksStorage
|
||||||
* Removes [children] from [BookmarkNode.children] and returns the new modified [BookmarkNode].
|
* Removes [children] from [BookmarkNode.children] and returns the new modified [BookmarkNode].
|
||||||
*/
|
*/
|
||||||
operator fun BookmarkNode.minus(children: Set<BookmarkNode>): BookmarkNode {
|
operator fun BookmarkNode.minus(children: Set<BookmarkNode>): BookmarkNode {
|
||||||
return this.copy(children = this.children?.filter { filtered ->
|
val removedChildrenGuids = children.map { it.guid }.toSet()
|
||||||
children.none {
|
return this.copy(children = this.children?.filterNot { removedChildrenGuids.contains(it.guid) })
|
||||||
it.guid == filtered.guid
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue