Skip to content

Commit

Permalink
chore: save lastAxisValue to a variable to avoid the !!
Browse files Browse the repository at this point in the history
  • Loading branch information
markvideon committed Jun 16, 2024
1 parent b15527c commit 7812811
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class EventListener {
val value = motionEvent.getAxisValue(axis) * multiplier

// No-op if threshold is not met
if (lastAxisValue[axis] != null) {
val lastValue = lastAxisValue[axis]!!
val lastValue = lastAxisValue[axis]
if (lastValue is Float) {
if (abs(value - lastValue) < axisEpisilon) {
return true;
}
Expand Down

0 comments on commit 7812811

Please sign in to comment.