Skip to content

Commit

Permalink
Std: fix listAt
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Mar 6, 2024
1 parent bab5c5f commit c40519d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/std/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ List.List = function(value) {
* @returns {Option<T>}
*/
function listAt(list, index) {
if (index < 0 || index >= list.value.length) {
const i = index.value
if (i < 0 || i >= list.value.length) {
return Option.None()
}
const e = list.value[index]
const e = list.value[i]
return Option.Some(e)
}

Expand Down

0 comments on commit c40519d

Please sign in to comment.