From d85cfec73c8124d2695a6b708680b760f3bd6363 Mon Sep 17 00:00:00 2001 From: David Schwartz Date: Tue, 6 Aug 2013 16:12:08 -0700 Subject: [PATCH] Bug fixes. --- modules/ripple_basics/containers/ripple_RangeSet.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ripple_basics/containers/ripple_RangeSet.cpp b/modules/ripple_basics/containers/ripple_RangeSet.cpp index 0509029e83..e02c7db462 100644 --- a/modules/ripple_basics/containers/ripple_RangeSet.cpp +++ b/modules/ripple_basics/containers/ripple_RangeSet.cpp @@ -69,7 +69,7 @@ uint32 RangeSet::getPrev (uint32 v) const if (it.second < v) return it.second; - if (contains (it, v + 1)) + if (contains (it, v - 1)) return v - 1; } return absent; @@ -97,6 +97,12 @@ uint32 RangeSet::prevMissing (uint32 v) const result = cur->first - 1; break; } + else if (v > cur->second) + { + if (v == cur->second + 1) + result = cur->first - 1; + break; + } } }