We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3b824e commit 7b0f13aCopy full SHA for 7b0f13a
app/src/main/java/com/tans/tfiletransporter/file/FileUtils.kt
@@ -88,14 +88,18 @@ fun List<FileLeaf.CommonFileLeaf>.toExploreFiles(): List<FileExploreFile> {
88
}
89
90
fun File.hasTargetParent(targetParent: File): Boolean {
91
- val parent = parentFile
92
- return if (parent == null) {
93
- false
+ return if (canonicalPath == targetParent.canonicalPath) {
+ true
94
} else {
95
- if (parent.canonicalPath == targetParent.canonicalPath) {
96
- true
+ val parent = parentFile
+ if (parent == null) {
+ false
97
98
- parent.hasTargetParent(targetParent)
+ if (parent.canonicalPath == targetParent.canonicalPath) {
99
100
+ } else {
101
+ parent.hasTargetParent(targetParent)
102
+ }
103
104
105
0 commit comments