summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qringbuffer_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qringbuffer_p.h')
-rw-r--r--src/corelib/tools/qringbuffer_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index c232ae3c72..76ab4a5b62 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -207,8 +207,9 @@ public:
Q_CORE_EXPORT char *reserveFront(qint64 bytes);
inline void truncate(qint64 pos) {
- if (pos < size())
- chop(size() - pos);
+ Q_ASSERT(pos >= 0 && pos <= size());
+
+ chop(size() - pos);
}
Q_CORE_EXPORT void chop(qint64 bytes);