Skip to content

Commit

Permalink
Slightly improve NavGraph.equals() performance
Browse files Browse the repository at this point in the history
Small trick to avoid unnecessary checks
androidx/androidx@06f18f7
  • Loading branch information
massivemadness committed Nov 1, 2023
1 parent 79101fb commit 181e753
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SwipeBackDestination constructor(
}

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || other !is SwipeBackDestination) return false
return super.equals(other) && className == other.className
}
Expand Down

0 comments on commit 181e753

Please sign in to comment.