Skip to content

Commit e31d1c2

Browse files
committed
fix code analytics
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent 31ed95a commit e31d1c2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/java/com/nextcloud/utils/extensions/SyncedFolderExtensions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ import com.owncloud.android.datamodel.SyncedFolder
1111
import com.owncloud.android.datamodel.SyncedFolderDisplayItem
1212
import java.io.File
1313

14-
1514
fun List<SyncedFolderDisplayItem>.filterEnabledOrWithoutEnabledParent(): List<SyncedFolderDisplayItem> {
1615
return filter { it.isEnabled || !hasEnabledParent(it.localPath) }
1716
}
1817

18+
@Suppress("ReturnCount")
1919
fun List<SyncedFolder>.hasEnabledParent(localPath: String?): Boolean {
2020
localPath ?: return false
2121

2222
val localFile = File(localPath).takeIf { it.exists() } ?: return false
2323
val parent = localFile.parentFile ?: return false
2424

25-
return any { it.isEnabled && File(it.localPath).exists() && File(it.localPath) == parent }
26-
|| hasEnabledParent(parent.absolutePath)
25+
return any { it.isEnabled && File(it.localPath).exists() && File(it.localPath) == parent } ||
26+
hasEnabledParent(parent.absolutePath)
2727
}

0 commit comments

Comments
 (0)