Skip to content

Commit 23f8d05

Browse files
committed
removing redundant exists() checks, mkdirs already does this
1 parent 8525925 commit 23f8d05

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncEphemeralTemporaryStore.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ internal class RoomSyncEphemeralTemporaryStoreFile @Inject constructor(
4040
) : RoomSyncEphemeralTemporaryStore {
4141

4242
private val workingDir: File by lazy {
43-
File(fileDirectory, "rr").also { it.mkdirs() }
43+
File(fileDirectory, "rr").also {
44+
it.mkdirs()
45+
}
4446
}
4547

4648
private val roomSyncEphemeralAdapter = moshi.adapter(RoomSyncEphemeral::class.java)

vector/src/main/java/im/vector/app/features/voice/AbstractVoiceRecorder.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ abstract class AbstractVoiceRecorder(
2828
) : VoiceRecorder {
2929
private val outputDirectory: File by lazy {
3030
File(context.cacheDir, "voice_records").also {
31-
if (!it.exists()) {
32-
it.mkdirs()
33-
}
31+
it.mkdirs()
3432
}
3533
}
3634

vector/src/main/java/im/vector/app/features/voice/VoicePlayerHelper.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ class VoicePlayerHelper @Inject constructor(
2929
) {
3030
private val outputDirectory: File by lazy {
3131
File(context.cacheDir, "voice_records").also {
32-
if (!it.exists()) {
33-
it.mkdirs()
34-
}
32+
it.mkdirs()
3533
}
3634
}
3735

0 commit comments

Comments
 (0)