QPostEventList: change pointer comparison to integer comparison

This is exactly the type of pointer arithmetics that GCC likes to
miscompile.

Just use offset >= size() (=subtract begin() from both sides).

Change-Id: Ifb13652d7b96bf4c06727d9c965516e95d16ab5c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2012-09-27 14:31:12 +02:00 committed by The Qt Project
parent b0a7974c6a
commit f9547c89ea

View File

@ -114,7 +114,7 @@ public:
int priority = ev.priority;
if (isEmpty() ||
last().priority >= priority ||
begin() + insertionOffset >= end()) {
insertionOffset >= size()) {
// optimization: we can simply append if the last event in
// the queue has higher or equal priority
append(ev);