From 6203024bc68c47dbc8809c5c73fb66e0a9ff8fc4 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 2 Jul 2013 10:54:15 -0700 Subject: [PATCH] Fix prevMissing --- modules/ripple_basics/containers/ripple_RangeSet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ripple_basics/containers/ripple_RangeSet.cpp b/modules/ripple_basics/containers/ripple_RangeSet.cpp index a5f4078cd7..83fb27e642 100644 --- a/modules/ripple_basics/containers/ripple_RangeSet.cpp +++ b/modules/ripple_basics/containers/ripple_RangeSet.cpp @@ -81,10 +81,10 @@ uint32 RangeSet::prevMissing (uint32 v) const BOOST_FOREACH (const value_type & it, mRanges) { if (contains (it, v)) - return it.first - 1; + return (it.first == 0) ? absent : (it.first - 1); - if (it.first > (v + 1)) - return v + 1; + if (it.second < (v - 1)) + return v - 1; } return absent; }