Skip to content

Commit

Permalink
Explain setCapacity better
Browse files Browse the repository at this point in the history
  • Loading branch information
marzipankaiser authored Jan 27, 2025
1 parent 70043aa commit 37c4911
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/common/resizable_array.effekt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def unsafeSetCapacity[T](arr: ResizableArray[T], capacity: Int): Unit = {
}
}

/// Change the dynamic to have exactly the given capacity
/// Change the resizable array to have exactly the given capacity.
/// This only changes the size of the backing array, not the `size`.
///
/// O(n)
def setCapacity[T](arr: ResizableArray[T], capacity: Int): Unit / Exception[OutOfBounds] = {
Expand Down

0 comments on commit 37c4911

Please sign in to comment.