From 1fd585a5a0644a5c0dd4ee5e18b40686fa9ec5a5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 May 2011 10:14:06 -0500 Subject: [svn-r20901] Remove if() that avoided a copy of the last element to itself. This was to solve an issue of a difference between 1.8 and trunk. 1.8 used the wrong variable in the if() and upon reflection the if() was determined to be unnecessary and complicated the logic. 1.8 tests would have treated the if() as always true with the result being the same as though the if() was absent. This change reflects that equivalance and will avoid a potential problem in 1.8. Tested: local linux, reviewed by two developers --- hl/src/H5DS.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 16ab14f..379b220 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -813,10 +813,8 @@ herr_t H5DSdetach_scale(hid_t did, /* same object, reset. we want to detach only for this DIM */ if(did_oi.fileno == tmp_oi.fileno && did_oi.addr == tmp_oi.addr) { - /* if we found not the last one, copy the last one to replace - the one which is found */ - if(ii < nelmts-1) - dsbuf[ii] = dsbuf[nelmts-1]; + /* copy the last one to replace the one which is found */ + dsbuf[ii] = dsbuf[nelmts-1]; nelmts--; found_dset=1; break; -- cgit v0.12