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].
|
||||
*/
|
||||
operator fun BookmarkNode.minus(children: Set<BookmarkNode>): BookmarkNode {
|
||||
return this.copy(children = this.children?.filter { filtered ->
|
||||
children.none {
|
||||
it.guid == filtered.guid
|
||||
}
|
||||
})
|
||||
val removedChildrenGuids = children.map { it.guid }.toSet()
|
||||
return this.copy(children = this.children?.filterNot { removedChildrenGuids.contains(it.guid) })
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue