summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.h
Commit message (Collapse)AuthorAgeFilesLines
* Updated year in copyright headerKai Koehne2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. 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: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* don't detach until the list is going to be modifiedRitt Konstantin2011-08-121-1/+0
| | | | | | | removeAt() does detach()'ing for us Merge-request: 1285 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* optimize QList::removeAll()Ritt Konstantin2011-08-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>
* Merge remote branch 'origin/4.7' into 4.8-from-4.7Rohan McGovern2011-05-181-17/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/network/access/qnetworkaccessdatabackend.cpp src/xmlpatterns/expr/qevaluationcache_p.h tests/auto/declarative/qdeclarativewebview/tst_qdeclarativewebview.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/qtconfig/mainwindowbase.cpp tools/qtconfig/paletteeditoradvancedbase.cpp tools/qtconfig/paletteeditoradvancedbase.ui tools/qtconfig/previewwidgetbase.ui
| * Fix a regression in QList::mid()Liang Qi2011-05-161-0/+2
| | | | | | | | | | | | | | It doesn't need to copy anything when pos is after size(). Task-number: QTBUG-19164 Reviewed-by: Oswald Buddenhagen
| * Update licenseheader text in source filesJyri Tahtela2011-05-131-17/+17
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Containers: add member-swapMarc Mutz2010-11-031-0/+1
| | | | | | | | | | | | | | Member-swap is required by the STL Sequence concept, but is also needed to write exception-safe code. Merge-request: 871 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | C++0x: being able to create a list with the {,,,} notationOlivier Goffart2010-09-031-0/+8
| | | | | | | | Reviewed-by: Joao
* | C++0x move operatorsOlivier Goffart2010-09-031-0/+4
| | | | | | | | | | | | | | This makes assignement faster from temporaries, as the operator is fully inline, and doesn't do any atomic operations. Reviewed-by: joao
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-251-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp src/declarative/qml/qdeclarativexmlhttprequest.cpp src/opengl/opengl.pro src/opengl/qgl_p.h src/plugins/bearer/connman/qconnmanservice_linux.cpp tests/auto/qpainter/tst_qpainter.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/assistant/tools/assistant/openpageswidget.h
| * Fix assignment of a container included in the container itselfOlivier Goffart2010-08-231-2/+3
| | | | | | | | | | Task-number: QTBUG-13079 Reviewed-by: Joao
* | Optimize ~QListOlivier Goffart2010-05-181-3/+2
|/ | | | | | | | | There is no need to check for d as it must never be 0 And the refcount ins QList::free() is nessecerly 0 since it is checked before the function is called Reviewed-by: ossi
* Don't use QList's begin() and end() where possible.Robin Burchell2010-04-261-2/+2
| | | | | | | This avoids an unnecessary iterator creation, which can speed up some cases. Merge-request: 2371 Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
* different approach to fixing "the other" aliasing issueOswald Buddenhagen2010-03-151-37/+15
| | | | | | | instead of copying the original value and constructing a Node later, construct a Node immediately and copy it later. Reviewed-by: thiago
* fix aliasing issue in node_construct()Oswald Buddenhagen2010-03-151-0/+8
| | | | | | | | | | invisible so far, but the next patch uncovers it. this could be possibly optimized for more compilers. however, i found no way to ask msvc whether it is doing an optimized build. Reviewed-by: thiago
* detach in fewer cases, remove redundant calculationOswald Buddenhagen2010-03-151-3/+1
| | | | Reviewed-by: thiago
* optimize appending of (empty) lists to (empty) listsOswald Buddenhagen2010-02-251-9/+16
| | | | | | | | if appending an empty lists, don't do anything. if appending to an empty list, just assign. this saves some needless detaches/reallocs. Reviewed-by: joao
* suppress pointer aliasing warningsOswald Buddenhagen2010-02-241-3/+6
| | | | | | | the code as such is safe, as no aliasing can occur here. so it is just a matter of making the compiler shut up. Reviewed-by: Olivier Goffart
* avoid double reallocations in inserting operationsOswald Buddenhagen2010-02-221-35/+96
| | | | | | | | | | | | operator+=() and co. would first detach, and then realloc if they found the reservation too small. in particular, appending anything to an empty list would trigger this double reallocation (first copy shared_null, then grow the copy). entirely rewritten take 3, this time without memory corruption or exhaustion ... :) Reviewed-by: joao
* create temporaries more intelligentlyOswald Buddenhagen2010-02-221-6/+28
| | | | | | | | | | | | | | | we already know that we are dealing with a movable type, so it is safe to keep a temporary copy of the raw data instead of going through the copy c'tor. this way we save a pretty useless ref()/deref() pair for each and every insertion of an implicitly shared type into a QList. the QtPodForSize class is somewhat ugly. we should use QIntegerForSize, but that's not possible without having separate template specializations, which is not possible without some bigger changes to the qt type info system. it will be beautified in due time. :) Reviewed-by: joao
* do not protect against self-assignment in QList::replace()Oswald Buddenhagen2010-02-221-6/+1
| | | | | | it's not the task of the container class to do so. Reviewed-by: joao
* make queues to which only lists are appended not blow the memoryOswald Buddenhagen2010-02-221-0/+1
| | | | | | | | append2(list) didn't use the array shifting logic the append() for single elements does. this would cause the list to grow endlessly despite leading elements being removed if only lists were ever appended. Reviewed-by: joao
* Merge remote branch 'origin/master' into qt-master-from-4.6Thiago Macieira2010-02-201-6/+35
|\ | | | | | | | | | | | | Conflicts: configure.exe src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp
| * Revert optimizations to QString::appendKai Koehne2010-02-181-24/+4
| | | | | | | | | | | | This reverts commit 03ac778172b783d26bb1c7c5d92bdedd045fcc92 and commit 02135be18f3c4b1d1525aff6dfe96c9c8521084d. They broke qt on all platforms (e.g. qmake didn't compile on Windows any more).
| * unbreak QList::append() and co. againOswald Buddenhagen2010-02-171-1/+1
| | | | | | | | | | | | | | | | make sure that the detached object is always at least as big as the original one. that may be somewhat wasteful, but it is no worse than before the detach() optimization. one may consider improvements later. Reviewed-by: joao
| * avoid double reallocations in appending operationsOswald Buddenhagen2010-02-161-4/+24
| | | | | | | | | | | | | | | | | | | | operator+=() and co. would first detach, and then realloc if they found the reservation too small. in particular, appending anything to an empty list would trigger this double reallocation (first copy shared_null, then grow the copy). Reviewed-by: joao Reviewed-by: denis
| * optimize QList::mid()Oswald Buddenhagen2010-02-161-3/+12
| | | | | | | | | | | | | | | | | | instead of append()ing each element separately, reserve enough space and do a low-level node copy. obviously, the gain for small simple types is the biggest. Reviewed-by: joao Reviewed-by: denis
| * add QList::reserve()Oswald Buddenhagen2010-02-161-3/+23
| | | | | | | | | | | | | | | | | | while this reserves memory "only" for the pointer list, this still amounts to 100% of the re-allocs for small simple types. for big/complex/static types the gain is lower, but still. Reviewed-by: Denis Reviewed-by: Joao
* | Merge remote branch 'origin/4.6' into qt-master-from-4.6Thiago Macieira2010-02-191-1/+1
|\ \ | | | | | | | | | | | | Conflicts: tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
| * | Revert "Added note to make QList destructor virtual in version 5"Zeno Albisser2010-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | Virtual functions should not be used with copyable types due to slicing. This reverts commit c1db6c2c5a3bbe96a628207af169a032d535426f.
* | | Merge remote branch 'origin/4.6' into integration-master-from-4.6Rohan McGovern2010-02-191-4/+4
|\| | | |/ |/| | | | | Conflicts: src/corelib/codecs/qtextcodec.h
| * Added note to make QList destructor virtual in version 5Zeno Albisser2010-02-171-1/+1
| | | | | | | | Reviewed-by: TrustMe
| * Change all ptrdiff_t to qptrdiff.Thiago Macieira2010-02-171-3/+3
| | | | | | | | Reviewed-By: Bradley T. Hughes
* | Merge branch '4.6'Thiago Macieira2010-01-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Update copyright year to 2010Jason McDonald2010-01-071-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | add {QString,QByteArray,QList,QLinkedList,QHash,QMap,QVector}::isSharedWith()Oswald Buddenhagen2009-12-101-0/+1
|/ | | | | | | | | | | | | | | | these functions just compare the d pointers of two objects. this can be used to verify the validity of cached data: you keep a copy of the original data in your cache. consequently, any changes to the original data must detach, so this function reflects whether the cached data is still up-to-date. of course, this is not thread safe, as the data might change right after you check it, but that's a general problem of cache coherency which needs to be handled further up the stack. the functions are internal because the other detaching-related functions are internal as well for reasons beyond me. Reviewed-by: brad
* Fix -Wconversion warnings where possible.David Faure2009-09-131-4/+4
| | | | | | | | | | | | In order to detect "int foo = myQReal" mistakes, one needs to compile with -Wconversion. However that flag triggers many warnings inside Qt. This commit fixes many of them, like qchar.h:295: warning: conversion to 'ushort' from 'unsigned int' may alter its value qglobal.h:1026: warning: conversion to 'qreal' from 'qint64' may alter its value qbytearray.h:441: warning: conversion to 'char' from 'int' may alter its value Other warnings remain (such as those coming from bitfields) Merge-request: 1460 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* exception safety fix for QList::operator+= (const QList&)mread2009-09-081-7/+12
| | | | | | | | | | | | | | | | The refactoring of current++ and src++ out of the new line makes the code easier to understand but it also seems to be significant at least in the ::isComplex case. I suspect that the ordering increment operations vs throw from new is not well defined, or not implemented as you might hope (with the ++ happening very last). The changes in the catch blocks mean that it deletes the created objects, rather than trying with the first failed object. The test code has been updated with a +=(Container) test, and to force testing of both static and moveable types. Reviewed-by: Harald Fernengel
* qlist.h uses memcpy() without including <string.h> or <cstring>Bernhard Rosenkraenzer2009-09-011-0/+1
| | | | | | | | | | | | | | | | | Attempting to make use of the inlined QList::node_copy without including <string.h> or <cstring> with gcc 4.4 results in (e.g.) /usr/lib64/qt4/include/QtCore/qlist.h: In member function "void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = net::Port]": /usr/lib64/qt4/include/QtCore/qlist.h:600: instantiated from "void QList<T>::detach_helper() [with T = net::Port]" /usr/lib64/qt4/include/QtCore/qlist.h:121: instantiated from "void QList<T>::detach() [with T = net::Port]" /usr/lib64/qt4/include/QtCore/qlist.h:462: instantiated from "void QList<T>::append(const T&) [with T = net::Port]" /usr/src/ark/BUILD/kdenetwork/kget/transfer-plugins/bittorrent/libbtcore/net/portlist.cpp:54: instantiated from here /usr/lib64/qt4/include/QtCore/qlist.h:388: error: "memcpy" was not declared in this scope Task-number: reported, but not yet assigned a number Merge-request: 1388 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Restore QList backward compatibilityHarald Fernengel2009-08-241-3/+5
| | | | | | | | | | | | | | | | Add detach3 and append2, leaving the old functions as they were. This ensures that new code will use the optimized version of QList, and old code will just continue calling the old functions. Reviewed-by: Thiago