Skip to content

Commit

Permalink
std: Add 'iter::reverseMut'
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed Dec 9, 2024
1 parent 56b1a0c commit 3358ba5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Std/Iteration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,12 @@ public static RuntimeGenerator Repeat(RuntimeObject item, RuntimeInteger? n = nu
public static RuntimeGenerator Reverse(IEnumerable<RuntimeObject> items)
=> new(items.Reverse());

[ElkFunction("reverseMut")]
public static void Reverse(RuntimeList items)
{
items.Values.Reverse();
}

/// <param name="items">All items</param>
/// <param name="count">The amount of items to skip from the left</param>
/// <returns>A generator for the first n items.</returns>
Expand Down

0 comments on commit 3358ba5

Please sign in to comment.