Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 812b92a

Browse files
committed
AutofillService: Speed item loading
Don't make cacheable function calls in loops Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
1 parent 9787489 commit 812b92a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ class AutofillService : AccessibilityService(), CoroutineScope by CoroutineScope
412412
// populate the dialog items, always with pick + pick and match. Could
413413
// make it optional (or make height a setting for the same effect)
414414
val itemNames = arrayOfNulls<CharSequence>(items.size + 2)
415+
val passwordDirectory = PasswordRepository.getRepositoryDirectory(applicationContext).toString()
416+
val autofillFullPath = settings!!.getBoolean("autofill_full_path", false)
415417
for (i in items.indices) {
416-
if (settings!!.getBoolean("autofill_full_path", false)) {
418+
if (autofillFullPath) {
417419
itemNames[i] = items[i].path.replace(".gpg", "")
418-
.replace(
419-
PasswordRepository.getRepositoryDirectory(applicationContext).toString() + "/",
420-
"")
420+
.replace("$passwordDirectory/", "")
421421
} else {
422422
itemNames[i] = items[i].name.replace(".gpg", "")
423423
}

0 commit comments

Comments
 (0)