JuliaCollections / JuliaCollections/DataStructures.jl

Bug: delete!(::MutableLinkedList, ::UnitRange)

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

Nobody has claimed this yet.

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

Description

This was verified on 0.18.8 and master

If a UnitRange with first == last is used then a boundary error is thrown. See https://github.com/JuliaCollections/DataStructures.jl/blob/master/src/mutable_list.jl#L182

I can't think of a reason for forbidding such situations thus I would suggest lowering the constraints to:

@boundscheck 0 < first(r) <= last(r) <= l.len || throw(BoundsError(l, r))

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

Read src/mutable_list.jl around line 182 and inspect the bounds check used by delete! for a UnitRange. Verify the behavior for a range whose first and last values are equal, then run the relevant test suite to confirm valid singleton ranges no longer raise a boundary error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.