1
0
Fork 0

Using bounds checking when accessing the intervals of skiplist index

This commit is contained in:
Michael Hackstein 2015-09-01 11:01:27 +02:00
parent a9e7adc1ed
commit 40a56efa24
1 changed files with 2 additions and 2 deletions

View File

@ -217,12 +217,12 @@ void SkiplistIterator::initCursor () {
if (_reverse) { if (_reverse) {
// start at last interval, right endpoint // start at last interval, right endpoint
_currentInterval = n - 1; _currentInterval = n - 1;
_cursor = _intervals[n -1]->_rightEndPoint; _cursor = _intervals.at(_currentInterval)->_rightEndPoint;
} }
else { else {
// start at first interval, left endpoint // start at first interval, left endpoint
_currentInterval = 0; _currentInterval = 0;
_cursor = _intervals[0]->_leftEndPoint; _cursor = _intervals.at(_currentInterval)->_leftEndPoint;
} }
} }
else { else {