diff options
author | David Boddie <dboddie@trolltech.com> | 2010-04-27 16:44:26 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-04-27 16:44:26 (GMT) |
commit | 0c47c08be649d17b7fdd1de1f87a325b7c051113 (patch) | |
tree | 5dd06f640d93205eebf837bed69f24fc0076e378 /src/corelib/tools | |
parent | 7eb7a125ea9f79dcfe3b0dc42d9d6017405e4b47 (diff) | |
parent | 9fb2faef7f7cf85175f35af32f2ff260d025982b (diff) | |
download | Qt-0c47c08be649d17b7fdd1de1f87a325b7c051113.zip Qt-0c47c08be649d17b7fdd1de1f87a325b7c051113.tar.gz Qt-0c47c08be649d17b7fdd1de1f87a325b7c051113.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qlist.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 67f63f3..722744c 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -267,9 +267,9 @@ public: inline int count() const { return p.size(); } inline int length() const { return p.size(); } // Same as count() inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); } - inline const T& first() const { Q_ASSERT(!isEmpty()); return *begin(); } + inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); } T& last() { Q_ASSERT(!isEmpty()); return *(--end()); } - const T& last() const { Q_ASSERT(!isEmpty()); return *(--end()); } + const T& last() const { Q_ASSERT(!isEmpty()); return at(count() - 1); } inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(begin()); } inline void removeLast() { Q_ASSERT(!isEmpty()); erase(--end()); } inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; } |