Mercurial > dive4elements > river
changeset 8100:786bb4f87e8d
Fix binarysearch logic in SedimentLoadData
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 15 Aug 2014 18:56:02 +0200 |
parents | e60ba7090667 |
children | 54dfdba4c4c5 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java Fri Aug 15 18:42:39 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java Fri Aug 15 18:56:02 2014 +0200 @@ -324,8 +324,8 @@ int mid = (lo + hi)/2; Value v = values.get(mid); int xid = v.getLoad().getId(); - if (xid < id) hi = mid-1; - else if (xid > id) lo = mid+1; + if (xid > id) hi = mid-1; + else if (xid < id) lo = mid+1; else return v.getValue(); }