Skip to content

Commit

Permalink
[Cleanup]: Fix Android Studio Warnings ankidroid#13282 (ankidroid#15957)
Browse files Browse the repository at this point in the history
* [Cleanup]: Fix Android Studio Warnings {regarding Constant Conditions}
  • Loading branch information
xenonnn4w authored Mar 21, 2024
1 parent 20504ac commit 2cc60e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions AnkiDroid/src/main/java/com/ichi2/anki/jsaddons/NpmUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ object NpmUtils {
val arr = name.split('/')
val scope = arr[0].removePrefix("@")
val isValidScopeName = validateName(scope)

if (!isValidScopeName) {
return isValidScopeName
}
if (!isValidScopeName) return false

// validate name again
return validateName(arr[1])
Expand Down
2 changes: 1 addition & 1 deletion AnkiDroid/src/test/java/com/ichi2/libanki/ConfigTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ConfigTest : JvmTest() {
assertThat(col.config.get("int"), equalTo(5))
// explicitly nulled key should work
col.config.set("null", JSONObject.NULL)
var b: Int? = null
val b: Int? = null
assertThat(col.config.get("null"), equalTo(b))
// missing key should be the same
assertThat(col.config.get("missing"), equalTo(b))
Expand Down

0 comments on commit 2cc60e8

Please sign in to comment.