JuliaCollections / JuliaCollections/DataStructures.jl

`resize!(::CircularBuffer, n)` is surprising

Open
#838 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
745
Forks
261
PR merge metrics
No merged PRs in 30d

Description

Following up on https://github.com/JuliaCollections/DataStructures.jl/pull/548#issuecomment-1227411169, resize! usually changes the length of collections, but not for CircularBuffer (am I missing an altenate convention in this package?). IMO it should be renamed, e.g. to sizehint!, or setcapacity! or capacity!. The introduction of resize! (#784) seems to not have yet been released, so this wouldn't be breaking.

This issue is similar to #447.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CircularBuffer resize! entry point and the discussion in PR #548 and issue #447. Decide whether the API should be renamed to sizehint!, setcapacity!, or capacity!, then check the introduction in #784 and ensure the chosen name is applied consistently before release.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.