Skip to content

Refresh inline documentation #135

@lexidor

Description

@lexidor

Some of the docblocks have drifted away from the implementation.
The most common cause of this drift is functions that have been changed to take Containers instead of Traversables.

/**
 * Returns a new vec containing the subsequence of the given Traversable
 * determined by the offset and length.
 *
 * If no length is given or it exceeds the upper bound of the Traversable,
 * the vec will contain every element after the offset.
 *
 * - To take only the first `$n` elements, see `Vec\take()`.
 * - To drop the first `$n` elements, see `Vec\drop()`.
 *
 * Time complexity: O(n), where n is the size of the slice
 * Space complexity: O(n), where n is the size of the slice
 */
<<__Rx>>
function slice<Tv>(
  Container<Tv> $container, // I am Container<T>, not Traversable<T>
  int $offset,
  ?int $length = null,
): vec<Tv>;

I will have a look at this later, when I have some time to kill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions