From e286e0d5230f73e491381d00a3f952f18378bc67 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sat, 3 Feb 2024 09:35:06 +0000 Subject: [PATCH] Use Kotlin's Enum.entries instead of Enum.values(). Signed-off-by: Kenneth J. Shackleton --- .../main/kotlin/com/bloomberg/selekt/android/SQLiteDatabase.kt | 2 +- .../test/kotlin/com/bloomberg/selekt/android/SQLDatabaseTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLiteDatabase.kt b/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLiteDatabase.kt index ea92cc75e3..efa65d4a2e 100644 --- a/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLiteDatabase.kt +++ b/selekt-android/src/main/kotlin/com/bloomberg/selekt/android/SQLiteDatabase.kt @@ -88,7 +88,7 @@ class SQLiteDatabase private constructor( * not possible to enable or disable auto-vacuum after a table has been created. */ var autoVacuum: SQLiteAutoVacuumMode - get() = SQLiteAutoVacuumMode.values()[Integer.parseInt(database.pragma("auto_vacuum"))] + get() = SQLiteAutoVacuumMode.entries[Integer.parseInt(database.pragma("auto_vacuum"))] set(value) { database.pragma("auto_vacuum", value) } /** diff --git a/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLDatabaseTest.kt b/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLDatabaseTest.kt index d2d90caa88..2bf3e6fe0c 100644 --- a/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLDatabaseTest.kt +++ b/selekt-android/src/test/kotlin/com/bloomberg/selekt/android/SQLDatabaseTest.kt @@ -56,7 +56,7 @@ private fun createFile( internal class SampleSQLArgumentsProvider : ArgumentsProvider { override fun provideArguments( context: ExtensionContext - ): Stream = (SQLiteJournalMode.values().filter { it != SQLiteJournalMode.MEMORY } * + ): Stream = (SQLiteJournalMode.entries.filter { it != SQLiteJournalMode.MEMORY } * arrayOf(ByteArray(32) { 0x42 }, null)).map { SQLInputs(it.first, it.second) }.map { Arguments.of(it) }.stream()