Iterator methods panic after copy #103

Closed
opened 2019-02-10 22:02:13 +00:00 by lthibault · 1 comment
lthibault commented 2019-02-10 22:02:13 +00:00 (Migrated from github.com)

Copying a treeset.Iterator will result in panics when treeset.Iterator.Value() is called. I suspect the same holds for all Iterate() methods.

Because Iterator is stateful, I suggest returning an *Iterator from all Iterate() methods.

Copying a `treeset.Iterator` will result in panics when `treeset.Iterator.Value()` is called. I suspect the same holds for all `Iterate()` methods. Because `Iterator` is stateful, I suggest returning an `*Iterator` from all `Iterate()` methods.
emirpasic commented 2019-07-16 07:21:04 +00:00 (Migrated from github.com)

@lthibault excuse the late replay, could you provide a sample code that triggers this behaviour?

@lthibault excuse the late replay, could you provide a sample code that triggers this behaviour?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
golibs/gms-gods#103
No description provided.