Skip to content

Commit

Permalink
i825-robovm: avoid usage of Java 8 getOrDefault method
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Aug 23, 2022
1 parent 727b7b7 commit 934a8f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library-impl/src/main/scala/special/collection/Helpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ object Helpers {
var nValues = 0
while (i < arr.length) {
val (key, value) = m(arr(i))
val pos = keyPositions.getOrDefault(key, 0)
val pos = {
val p: Integer = keyPositions.get(key)
if (p == null) 0 else p.intValue()
}

if (pos == 0) {
keyPositions.put(key, nValues + 1)
keys += key
Expand Down

0 comments on commit 934a8f5

Please sign in to comment.