reorder statements in Deque getFront and getBack, so that both functions return on every control path
Signed-off-by: DNKpp <DNKpp2011@gmail.com>
This commit is contained in:
parent
0bda62ad5b
commit
a209b89e59
|
@ -495,18 +495,14 @@ class Deque {
|
|||
|
||||
/// Return a reference to the first item of the deque
|
||||
const T& getFront() const {
|
||||
if (mSize > 0) {
|
||||
return mChunks[mFirstChunkIndex][mFirstItemIndex];
|
||||
}
|
||||
assert(false);
|
||||
assert(mSize > 0);
|
||||
return mChunks[mFirstChunkIndex][mFirstItemIndex];
|
||||
}
|
||||
|
||||
/// Return a reference to the last item of the deque
|
||||
const T& getBack() const {
|
||||
if (mSize > 0) {
|
||||
return mChunks[mLastChunkIndex][mLastItemIndex];
|
||||
}
|
||||
assert(false);
|
||||
assert(mSize > 0);
|
||||
return mChunks[mLastChunkIndex][mLastItemIndex];
|
||||
}
|
||||
|
||||
/// Clear the elements of the deque
|
||||
|
|
Loading…
Reference in New Issue
Block a user