summaryrefslogtreecommitdiffstats
path: root/src/H5Oalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oalloc.c')
-rw-r--r--src/H5Oalloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 98bbf0b..bad89ae 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -1234,10 +1234,10 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx)
/* Keep first one found */
if (found_null < 0)
found_null = (ssize_t)idx;
- else
- /* Check for better fit */
- if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size)
+ /* Check for better fit */
+ else if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size) {
found_null = (ssize_t)idx;
+ }
else {
/* If they are the same size, choose the one in the earliest chunk */
if (oh->mesg[idx].raw_size == oh->mesg[found_null].raw_size) {