diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-14 15:37:50 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-14 15:37:50 +0000 |
commit | 581a6d8501ff5614297da837b81ed3b6956361ea (patch) | |
tree | 985ee91d0ca1d3e6506ac5ff7e37f5b67adfec09 /include/llvm/DebugInfo/MSF/StreamArray.h | |
parent | 909545a822eef491158f831688066f0ec2866938 (diff) |
Diffstat (limited to 'include/llvm/DebugInfo/MSF/StreamArray.h')
-rw-r--r-- | include/llvm/DebugInfo/MSF/StreamArray.h | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/include/llvm/DebugInfo/MSF/StreamArray.h b/include/llvm/DebugInfo/MSF/StreamArray.h index 3bba80d807f3f..5dfeb8c524af3 100644 --- a/include/llvm/DebugInfo/MSF/StreamArray.h +++ b/include/llvm/DebugInfo/MSF/StreamArray.h @@ -153,30 +153,24 @@ public: return ThisValue; } - IterType &operator+=(std::ptrdiff_t N) { - while (N > 0) { - // We are done with the current record, discard it so that we are - // positioned at the next record. - IterRef = IterRef.drop_front(ThisLen); - if (IterRef.getLength() == 0) { - // There is nothing after the current record, we must make this an end - // iterator. + IterType &operator++() { + // We are done with the current record, discard it so that we are + // positioned at the next record. + IterRef = IterRef.drop_front(ThisLen); + if (IterRef.getLength() == 0) { + // There is nothing after the current record, we must make this an end + // iterator. + moveToEnd(); + } else { + // There is some data after the current record. + auto EC = Extract(IterRef, ThisLen, ThisValue); + if (EC) { + consumeError(std::move(EC)); + markError(); + } else if (ThisLen == 0) { + // An empty record? Make this an end iterator. moveToEnd(); - return *this; - } else { - // There is some data after the current record. - auto EC = Extract(IterRef, ThisLen, ThisValue); - if (EC) { - consumeError(std::move(EC)); - markError(); - return *this; - } else if (ThisLen == 0) { - // An empty record? Make this an end iterator. - moveToEnd(); - return *this; - } } - --N; } return *this; } |