diff options
author | James Laird <jlaird@hdfgroup.org> | 2007-01-30 20:40:44 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2007-01-30 20:40:44 (GMT) |
commit | 25b96dc712e467b5efe7b166c078e33ed8aef86c (patch) | |
tree | 35244758745eded0d0e160e5564f6653194a9c30 /src/H5SMbtree2.c | |
parent | 7c733b0afb1b87ddd3314e89b0105b806f6edfb1 (diff) | |
download | hdf5-25b96dc712e467b5efe7b166c078e33ed8aef86c.zip hdf5-25b96dc712e467b5efe7b166c078e33ed8aef86c.tar.gz hdf5-25b96dc712e467b5efe7b166c078e33ed8aef86c.tar.bz2 |
[svn-r13224] Fixed a bug where messages would report their "raw size" as the size of a
shared message rather than the full size of the unshared message, which
confused some shared message code.
Added a test that should make sure that some messages are too small to be
written to the deletion test in tsohm.c.
Also added a small optimization so that hash values don't need to be
calculated on deletes in list indexes.
Tested on Windows, smirom, and kagiso.
Diffstat (limited to 'src/H5SMbtree2.c')
-rwxr-xr-x | src/H5SMbtree2.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index f1d12da..908729a 100755 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -143,14 +143,26 @@ H5SM_message_compare(const void *rec1, const void *rec2) */ /* JAMES HDassert(mesg->ref_count > 0); */ + /* If the key has an fheap ID, we're looking for a message that's + * already in the index; if the fheap ID matches, we've found the message + * and can stop immediately. + * This means that list indexes that don't care about ordering can + * pass in bogus hash values and they'll still get a match if the heap + * IDs are the same. + */ + if(key->encoding_size == 0) + { + HDassert(key->encoding == NULL); + if(key->message.fheap_id == mesg->fheap_id) + HGOTO_DONE(0); + } + hash_diff = key->message.hash; hash_diff -= mesg->hash; /* If the hash values match, make sure the messages are really the same */ if(0 == hash_diff) { - /* Compare either the heap_ids directly (if the key has one) - * or the encoded buffers - */ + /* Compare the encoded buffers or the fheap IDs */ if(key->encoding_size == 0) { HDassert(key->encoding == NULL); @@ -182,6 +194,7 @@ H5SM_message_compare(const void *rec1, const void *rec2) ret_value = -1; } +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5SM_message_compare */ |