JuliaCollections / DataStructures.jl

Julia implementation of Data structures
https://juliacollections.github.io/DataStructures.jl/latest/
MIT License
690 stars 244 forks source link

Ill logic of MutableLinkedList.node #795

Open algorithmx opened 2 years ago

algorithmx commented 2 years ago

https://github.com/JuliaCollections/DataStructures.jl/blob/f90dd8ceb1808123136d96599fbf41407ef4fadc/src/mutable_list.jl#L19

Code

A = MutableLinkedList{Int}(1,2,3)
node = A.node
for i=1:8
    println(node.data)
    node = node.next
end

Result

140155178173488
1
2
3
140155178173488
1
2
3

Version

julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

julia> 
algorithmx commented 2 years ago

related issue https://github.com/JuliaCollections/DataStructures.jl/issues/794