Skip to content

Commit

Permalink
Update Iteration.kt
Browse files Browse the repository at this point in the history
Forgot the i
  • Loading branch information
EngineMachiner committed Jul 4, 2024
1 parent 8406ef6 commit 2c7c586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/enginemachiner/harmony/Iteration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.enginemachiner.harmony
/** Gets value and cycles if the index is out of bounds. */
fun <T: Any> cycle( collection: Collection<T>, value: T, i: Int = 1 ): T {

val size = collection.size; val i = collection.indexOf(value) + 1
val size = collection.size; val i = collection.indexOf(value) + i

return collection.elementAt( i % size )

Expand Down

0 comments on commit 2c7c586

Please sign in to comment.