On Wed, Jul 5, 2017 at 1:46 PM, jacobus erps <jacobus.erps@xxxxxxxxx>
So we *shouldn't* mutate the keys, but what if we do anyway? Can the
tree become corrupted?
I think it's just like using a Java Map.
You can put any object in it as key as long as it supports the compareTo
method (defined at Object).
When you add a key/item pair the key will be inserted inbetween the other
keys in the right order.
This order won't change; it's fixed.
So if you change the key in some way which affects the sorting order, the
sorting order won't reflect the position in the map. So yes, then it's
corrupt. You just should not do that, the same with Java.
Wow. Really? I didn't expect that Java would let you do that. I don't
know Java very well, but I thought it was supposed to be a very "safe"
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.