Re: [xml] xmlHashAddEntry/xmlHashScan behaviour



On Wed, Oct 31, 2012 at 09:22:17AM +0300, Nikolay Sivov wrote:
On 10/31/2012 08:09, Daniel Veillard wrote:
On Wed, Oct 31, 2012 at 08:45:35AM +0300, Nikolay Sivov wrote:
Hi,

Got a question on libxml2 hash implementation.
Let's say I want to have index access to hash data, so I call

xmlHashAddEntry for item1
xmlHashAddEntry for item2
xmlHashAddEntry for item3

Is it wrong assumption to expect xmlHashScan calling back exactly in
same order as I added these entries?
  It is a wrong assumption. You can't expect any specific
order back from xmlHashScan() callbacks.
Ok, thanks. I'll workaround that then. Btw, is it possible recently
added hash randomization made
this "more" visible? I mean I was lucky enough it seems that a very
limited test case (of two entries, well I know),
worked with older version and now it fails from time to time.

  yes it's very possible that this added randomization just exposed that
to you, you were just lucky until now :-)

Daniel

-- 
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/



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