We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e7b013 commit 362f63dCopy full SHA for 362f63d
1 file changed
app/src/main/java/io/github/sds100/keymapper/util/ListUtils.kt
@@ -7,6 +7,10 @@ import java.util.Collections
7
*/
8
9
fun MutableList<*>.moveElement(fromIndex: Int, toIndex: Int) {
10
+ if (toIndex >= size || fromIndex >= size) {
11
+ return
12
+ }
13
+
14
if (fromIndex < toIndex) {
15
for (i in fromIndex until toIndex) {
16
Collections.swap(this, i, i + 1)
0 commit comments