Re: [gtk-list] Are GHashTable's deterministic?



> Is this the real explanation?
> 
> If this is, it is quite annoying because it leads to a behavior
> depending on the code size. When debuging, adding code will then lead to
> unreproductible behavior. Is there a solution to this problem?
> 
> Thanks a lot for any comment.
> 

Has your foreach handler any side-effects, i.e does it change some global
variable ? Hashes are not sorted, and you cannot depend on your handler
being called in any specific order. If the handler changes some global
variable, unpredictable results can occur.


Eivind

---

| Mail: eivindkv@ifi.uio.no               | Lazy on IRC
| HP: www.stud.ifi.uio.no/~eivindkv       | Experience is what causes
| Tlf: 22187263 / 95255807                | a person to make new mistakes
| Jobb: 23179507 / eivind@fondspartner.no | instead of old ones.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]