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

Commit 7475f2f

Browse files
committed
fix: replace Enum.values() with Enum.entries
1 parent 14cc25a commit 7475f2f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

app/src/main/java/app/passwordstore/util/autofill/AutofillPreferences.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ enum class DirectoryStructure(val value: String) {
117117

118118
val DEFAULT = FileBased
119119

120-
private val reverseMap = values().associateBy { it.value }
120+
private val reverseMap = entries.associateBy { it.value }
121121

122122
fun fromValue(value: String?) = if (value != null) reverseMap[value] ?: DEFAULT else DEFAULT
123123
}

app/src/main/java/app/passwordstore/util/git/sshj/SshKey.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ object SshKey {
140140

141141
companion object {
142142

143-
fun fromValue(value: String?): Type? = values().associateBy { it.value }[value]
143+
fun fromValue(value: String?): Type? = entries.associateBy { it.value }[value]
144144
}
145145
}
146146

openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class AutocryptPeerUpdate() : Parcelable {
2929
private constructor(source: Parcel, version: Int) : this() {
3030
keyData = source.createByteArray()
3131
effectiveDate = if (source.readInt() != 0) Date(source.readLong()) else null
32-
preferEncrypt = PreferEncrypt.values()[source.readInt()]
32+
preferEncrypt = PreferEncrypt.entries[source.readInt()]
3333
}
3434

3535
public fun createAutocryptPeerUpdate(keyData: ByteArray?, timestamp: Date?): AutocryptPeerUpdate {

openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class OpenPgpSignatureResult : Parcelable {
6060
// backward compatibility for this exact version
6161
if (version > 2) {
6262
senderStatusResult =
63-
readEnumWithNullAndFallback(source, SenderStatusResult.values(), SenderStatusResult.UNKNOWN)
63+
readEnumWithNullAndFallback(source, SenderStatusResult.entries, SenderStatusResult.UNKNOWN)
6464
confirmedUserIds = source.createStringArrayList()
6565
} else {
6666
senderStatusResult = SenderStatusResult.UNKNOWN
@@ -74,7 +74,7 @@ public class OpenPgpSignatureResult : Parcelable {
7474
}
7575
autocryptPeerentityResult =
7676
if (version > 4) {
77-
readEnumWithNullAndFallback(source, AutocryptPeerResult.values(), null)
77+
readEnumWithNullAndFallback(source, AutocryptPeerResult.entries, null)
7878
} else {
7979
null
8080
}

ssh/src/main/kotlin/app/passwordstore/ssh/SSHKeyType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public enum class SSHKeyType(internal val value: String) {
1010

1111
public companion object {
1212

13-
public fun fromValue(type: String?): SSHKeyType? = values().associateBy { it.value }[type]
13+
public fun fromValue(type: String?): SSHKeyType? = entries.associateBy { it.value }[type]
1414
}
1515
}

0 commit comments

Comments
 (0)