On 08/30/12 12:31, Brock Pytlik wrote:
On 08/30/12 09:14, Shawn Walker wrote:
...
I considered that option, but didn't pursue it because it felt like a
potentially riskier change. Not only that, these are the only two
cases (that I could discover) that expected to be able to modify the
list, so imposing the (admittedly minor) overhead of a copy on every
caller seemed overkill.
I really think this is the better solution. I don't think having a
function that sometimes returns something that can be modified and
sometimes something that's been cached is good code structure. I don't
really think it's a riskier change either.

I understand, and that's why I said I'd file a bug to have the solver use more immutable data structures as I think that's the right solution long term.

With some care, these sections could probably be rewritten to avoid the need to use the reverse() at all, so no copy would be needed. I tried that, but the changes needed were pretty drastic, and thus riskier.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to