FogBugz (Case [Issue]5602) Collection - LinkedList at: index putLink: aLink

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FogBugz (Case [Issue]5602) Collection - LinkedList at: index putLink: aLink

Pharo Issue Tracker
A FogBugz case was edited by Henrik Johansen.

Case ID:      5602
Title:        LinkedList at: index putLink: aLink
Status:       Closed (Fix Integrated)
Category:     Bug
Project:      Collection
Area:         Misc
Priority:     3 - Must Fix
Milestone:    Pharo3.0: 29/04/2013
Assigned To:  CLOSED

URL:          https://pharo.fogbugz.com/default.asp?5602

at:putLink: is basically the equivalent of the "old" protocol which accepted link (add:, addLink: in Pharo), added for SequenceableCollection compatability.

The pitfalls noted by Nicolas wrt adding links from other collections/adding a link already an element, also exists for add(Link):, without anyone complaining so far :)

I'd rather say it, like addLink:, is a performance option to avoid the overhead of at:put for elements known to be links, such as Processes. In that context, it makes no sense to move all code to at:put:.

In light of custom Link subclasses being a valid use case, merely substituting the value: of an existing link isn't really an option either.

Extra overhead from checking if link comes from self when at:putLink'ing, sorta defeats the performance intent as well.

Basically; a method intended for when/if you need the speed, and know what you're doing. (Maybe an oxymoron being O(n) and all in the first place... )

Which, I guess, sorta sums up my rationale at the time, and why it looks the way it looks today.


You are subscribed to this case.  If you do not want to receive automatic notifications in the future, unsubscribe (https://pharo.fogbugz.com/default.asp?pre=preUnsubscribe&pg=pgEditBug&command=view&ixBug=5602) from this case.

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker