summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove QBool and use bool instead.David Faure2012-01-201-4/+4
| | | | | | | | | | | | QBool was introduced with Qt-4.0, to detect Qt3-like code like if (c.contains(d) == 2) and break compilation on such constructs. This isn't necessary anymore, given that such code couldn't possibly compile in Qt4 times. And QBool was confusing developers, and creating compile errors (e.g. QVariant doesn't have support for it), so better remove it for Qt 5. Change-Id: I6642f43f5e12b872f98abb56600186179f072b09 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't crash by modifying read-only shared_nullBradley T. Hughes2011-10-041-1/+1
| | | | | | | | | | | | | | | | | | | Functions that modify the d-pointer must detach or otherwise take measures to not modify the const, read-only shared_null. The setSharable(bool) function takes care to detach when setting sharable to false, but should avoid setting the sharable data member unless d is not the shared null. Similarly, QMap<Key, T>::setInsertInOrder() needs to detach if it is shared with the shared_null (the logic has been updated to be the same as setSharable()). Change-Id: Ida5cb9818b86695f1b9f0264418b955c56424898 Reviewed-on: http://codereview.qt-project.org/5929 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Make QListData::shared_null constBradley T. Hughes2011-09-261-7/+8
| | | | | | | | | | Similar to QMap, QVector, QByteArray and QString, keep the shared_null in shareable memory and never modify it. Change-Id: I2b4bb8de564080021043f6ede6c903d567c686cf Reviewed-on: http://codereview.qt-project.org/4531 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* don't detach until the list is going to be modifiedRitt Konstantin2011-09-121-1/+0
| | | | | | | | | | | | | | removeAt() does detach()'ing for us Merge-request: 1285 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 52223d80ec8ba6d579c091efe0e40589a5d2bd67) Change-Id: I78865e19f989d9079c8dee47b8cf1bdf7e5db261 Reviewed-on: http://codereview.qt-project.org/4578 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* optimize QList::removeAll()Ritt Konstantin2011-09-121-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a) don't detach until an occurrence found b) don't memmove every time an occurrence found c) truncate quickly ) well, numbers are better than words: before: RESULT : tst_QList::removeAll_primitive(): 2,617,902 CPU ticks per iteration (total: 261,790,171, iterations: 100) RESULT : tst_QList::removeAll_movable(): 2,547,540 CPU ticks per iteration (total: 254,753,960, iterations: 100) RESULT : tst_QList::removeAll_complex(): 16,852,099 CPU ticks per iteration (total: 1,685,209,906, iterations: 100) after: RESULT : tst_QList::removeAll_primitive(): 73,520 CPU ticks per iteration (total: 73,520,442, iterations: 1000) RESULT : tst_QList::removeAll_movable(): 90,422 CPU ticks per iteration (total: 90,422,464, iterations: 1000) RESULT : tst_QList::removeAll_complex(): 9,667,073 CPU ticks per iteration (total: 9,667,072,670, iterations: 1000) Merge-request: 1285 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit b209fe3b1a51f64541067917e96de99f14ad65f3) Change-Id: Ia26036ed741cefcf4b5868b7b2fc5eae8130d3dc Reviewed-on: http://codereview.qt-project.org/4577 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Rename the private helper function QList::free() to QList::dealloc()Bradley T. Hughes2011-09-011-7/+6
| | | | | | | | | | As the comment suggests, renaming this function avoids confusion with libc's free(). Change-Id: Ia077b92c947d81ef9d78de940a1cd8ed022edb3c Reviewed-on: http://codereview.qt.nokia.com/4063 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove declarations for QListData functions removed by 36c29abBradley T. Hughes2011-09-011-5/+1
| | | | | | | | | | | | | This commit removed the function implementations, but not the declarations. This removes QListData::append2(T) but moves the optimized QListData::append2(T) implementation to QListData::append(T) Change-Id: I39b6dea31420a7cefe079b94a91a96eb16000d2a Reviewed-on: http://codereview.qt.nokia.com/4062 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* remove QT3_SUPPORT from corelib/toolsLars Knoll2011-06-291-14/+0
| | | | | | | Change-Id: Ie224cf992be675c7d405d4be05e4acd4157e590e Reviewed-on: http://codereview.qt.nokia.com/863 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Fix a regression in QList::mid()Liang Qi2011-05-271-0/+2
| | | | | | | | | | | | It doesn't need to copy anything when pos is after size(). Task-number: QTBUG-19164 Reviewed-by: Oswald Buddenhagen (cherry picked from commit 8befc4982a32752e48c82cacbed045e7336a3569) Change-Id: Iccac75842616f0d41e457e844a15d1a3ccfeb642 Reviewed-on: http://codereview.qt.nokia.com/164 Reviewed-by: Liang Qi <liang.qi@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+900
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12