General

Profile

fanjieqi (jieqi fan)

  • Registered on: 09/15/2016
  • Last connection: 10/25/2019

Issues

Activity

09/15/2016

05:23 PM Ruby master Bug #12765: An [element] multiply an number, every element in the list would be modified after modifying only one of then.
`
element = [1]
list = Array.new(3) { element }
p list #[[1], [1], [1]]
list[0][0] = -1 # should be [[-1], [1], [...
fanjieqi (jieqi fan)
04:45 PM Ruby master Bug #12765 (Rejected): An [element] multiply an number, every element in the list would be modified after modifying only one of then.
`
element = [1]
list = [element.clone] * 3
p list #[[1], [1], [1]]
list[0][0] = -1 # should be [[-1], [1], [1]]
...
fanjieqi (jieqi fan)

Also available in: Atom