From 0a8b9d41fd3651c2892179fe642e306faa9bd6d8 Mon Sep 17 00:00:00 2001
From: lukstbit <52494258+lukstbit@users.noreply.github.com>
Date: Mon, 4 Sep 2023 13:47:54 +0300
Subject: [PATCH] Cleanup code of libanki.Storage
---
AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt
index 334eb8c1c561..bf44120721ef 100644
--- a/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt
+++ b/AnkiDroid/src/main/java/com/ichi2/libanki/Storage.kt
@@ -13,8 +13,6 @@
* You should have received a copy of the GNU General Public License along with *
* this program. If not, see . *
*/
-@file:Suppress("FunctionName") // _createDb and other names defined by libAnki
-
package com.ichi2.libanki
import com.ichi2.anki.UIUtils.getDayStart
@@ -31,8 +29,8 @@ object Storage {
/**
* Open a new or existing collection.
*
- * @param Path The path to the collection.anki2 database. Should be unicode.
- * path should be tested with File.exists() and File.canWrite() before this is called.
+ * @param path The path to the collection.anki2 database. Should be unicode.
+ * path should be tested with [File.exists] and [File.canWrite] before this is called.
* */
fun collection(
path: String,
@@ -44,7 +42,7 @@ object Storage {
}
/**
- * Called as part of Collection initialization. Don't call directly.
+ * Called as part of [Collection] initialization. Don't call directly.
*/
internal fun openDB(path: String, backend: Backend, afterFullSync: Boolean): Pair {
val dbFile = File(path)
@@ -58,12 +56,12 @@ object Storage {
// initialize
if (create) {
- _createDB(db, time)
+ createDB(db, time)
}
return Pair(db, create)
}
- private fun _createDB(db: DB, time: Time) {
+ private fun createDB(db: DB, time: Time) {
// This line is required for testing - otherwise Rust will override a mocked time.
db.execute("update col set crt = ?", getDayStart(time) / 1000)
}