Re: [libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Peter Krempa
On Tue, Apr 16, 2019 at 15:32:31 +0100, Daniel Berrange wrote: > On Tue, Apr 16, 2019 at 04:26:49PM +0200, Peter Krempa wrote: > > On Tue, Apr 16, 2019 at 15:17:31 +0100, Daniel Berrange wrote: > > > On Tue, Apr 16, 2019 at 04:09:54PM +0200, Peter Krempa wrote: [...] > > Currently there aren't an

Re: [libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Daniel P . Berrangé
On Tue, Apr 16, 2019 at 04:41:57PM +0200, Peter Krempa wrote: > On Tue, Apr 16, 2019 at 15:32:31 +0100, Daniel Berrange wrote: > > On Tue, Apr 16, 2019 at 04:26:49PM +0200, Peter Krempa wrote: > > > On Tue, Apr 16, 2019 at 15:17:31 +0100, Daniel Berrange wrote: > > > > On Tue, Apr 16, 2019 at 04:09

Re: [libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Daniel P . Berrangé
On Tue, Apr 16, 2019 at 04:09:54PM +0200, Peter Krempa wrote: > In cases when the hash function for a name collides with other entry > already in the hash we prepend to the bucket. This creates a 'stack > effect' on the buckets if we then iterate through the hash. Normally > this is not a problem,

Re: [libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Daniel P . Berrangé
On Tue, Apr 16, 2019 at 04:26:49PM +0200, Peter Krempa wrote: > On Tue, Apr 16, 2019 at 15:17:31 +0100, Daniel Berrange wrote: > > On Tue, Apr 16, 2019 at 04:09:54PM +0200, Peter Krempa wrote: > > > In cases when the hash function for a name collides with other entry > > > already in the hash we pr

Re: [libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Peter Krempa
On Tue, Apr 16, 2019 at 15:17:31 +0100, Daniel Berrange wrote: > On Tue, Apr 16, 2019 at 04:09:54PM +0200, Peter Krempa wrote: > > In cases when the hash function for a name collides with other entry > > already in the hash we prepend to the bucket. This creates a 'stack > > effect' on the buckets

Re: [libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Daniel P . Berrangé
On Tue, Apr 16, 2019 at 04:09:54PM +0200, Peter Krempa wrote: > In cases when the hash function for a name collides with other entry > already in the hash we prepend to the bucket. This creates a 'stack > effect' on the buckets if we then iterate through the hash. Normally > this is not a problem,

[libvirt] [PATCH] util: hash: Append to hash buckets when adding new entries

2019-04-16 Thread Peter Krempa
In cases when the hash function for a name collides with other entry already in the hash we prepend to the bucket. This creates a 'stack effect' on the buckets if we then iterate through the hash. Normally this is not a problem, but in tests we want deterministic results. Since it does not matter