Commit Graph

56 Commits

Author SHA1 Message Date
Wilson E. Alvarez c0e1e91373 Performance tweak: Use range-based for-loops and allocate std::vector size() and *end() on the stack where favorable. (#16716)
* Use range-based for-loops and allocate std::vector size(), end(), cend(), rend(), crend() on the stack where favorable.

Other minor trivial changes were applied.

* Fixed Android compilation error

* Fixed windows-universal compilation error
2016-10-27 15:10:24 +08:00
mogemimi c0e4780e77 Fix implicit conversion issues with Xcode 7.3 2016-04-07 17:01:17 +09:00
Nam Hyeon Uk 7f2b0edc04 Vector iterator declaration & initializer list constructor
* Vector iterator typedef -> alias declaration

* Vector constructor with initializer list

* fix indent
2016-04-07 13:47:01 +08:00
JANG SUN HYUK 107cef0667 getRandomObject() in Vector, Map is changed
* getRandomObject is changed

https://github.com/cocos2d/cocos2d-x/issues/15270

getRandomObject issue in Vector

* Update CCMap.h

* Update CCVector.h
2016-04-07 11:46:54 +08:00
mogemimi 37b0d7c217 Mark equals() functions as const 2016-01-22 06:09:27 +09:00
Martin Taylor 62e36e8006 fix typos and syntax error. A thorough check by tool VSSpellChecker. 2015-09-22 16:08:23 +08:00
andyque 602093e474 fix extra @ symbol in Base group 2015-03-27 12:01:20 +08:00
WenhaiLin 2caff4e64d [ci skip]Update comments 2015-03-24 14:12:58 +08:00
minggo 4973de2b25 add more doxygen document 2015-03-24 11:15:40 +08:00
minggo e86e954abf add doxygen comment for CCVector.h 2015-03-23 22:13:04 +08:00
Huabing.Xu 91314ed504 remove CC_DLL for template class and CC_DLL for CCValue 2014-07-14 18:40:10 +08:00
Ricardo Quesada 8bb8416c26 Improved directory structure 2014-04-29 17:37:36 -07:00
Ricardo Quesada 9b118e5e96 Squashed commit of the following:
commit 519fcd7f68e3586c376fd5e8d4a0ee220a48d225
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 10:10:06 2014 -0700

    Updates templates files

commit 2b07843ebe592f56b2abc544ccf66d441bb19fc5
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 10:08:19 2014 -0700

    compiles on Windows

commit b175522ef7205eaab3bd3f26c27c5d6514cbe2a4
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:55:30 2014 -0700

    adds cocos2d.h

commit 4c3d14f929bac017b93ca843b4f149d352264a30
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:54:24 2014 -0700

    re-adds missing files

commit f729181728959260d14c4152555534f5beec8e05
Merge: 148da79 2adac67
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:51:12 2014 -0700

    Merge branch 'includes_fixes' of github.com:ricardoquesada/cocos2d-x into includes_fixes

commit 148da79010c5dffeab885933624cffaf3d588852
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:49:12 2014 -0700

    Adds SimpleAudioEngine

commit 2adac67019180ec82b7bd03f0b67c12f62e29e77
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:47:45 2014 -0700

    Compiles for Android

commit 4a300d1b9225fa5708f25a69a50bb531f0ac1a32
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:13:35 2014 -0700

    Fixes the includes
2014-04-26 10:11:22 -07:00
James Chen b300cfa1d2 issue #4106: Updates comments for 'Vector::eraseObject' 2014-02-21 11:30:55 +08:00
James Chen c6b2b86fe5 closed #4106: Object which isn't in Vector would also be released when invoking Vector::eraseObject.
Also refactored 'Vector::eraseObject':
1) Removed 'toRelease' parameter, Vector class should manage reference count.
2) Added 'removeAll' parameter to decide wether to remove all elements with the same value or just the first occurrence .
3) Added relevant UnitTest for 'Vector::eraseObject'.
2014-02-21 11:24:37 +08:00
James Chen 5e6130c92c issue #4058: Get rid of Object ,rename it to Ref. 2014-02-20 10:53:49 +08:00
walzer d4c1aa92d5 add copyrights for 2014, in folders other then 2d. 2014-01-07 11:47:11 +08:00
James Chen 9342ae105a issue #3577: const_iterator —> iterator for Vector::erase(first, last). Makes android build happy. 2014-01-04 11:41:06 +08:00
andyque 67153f816c remove unused code 2014-01-03 10:44:43 +08:00
andyque 0e90ef8337 fix move assignment operator doesn't clear previous content bug 2014-01-03 10:39:53 +08:00
andyque 75d5bcfb42 remove const modifier of move semantic 2014-01-02 18:05:22 +08:00
andyque 80adda2ce8 fixed self assignment error and provide move semantics to pushBack of Vector<T> 2014-01-02 17:54:52 +08:00
James Chen a8d93ddf72 Restricts the element type for Vector<T> and Map<K, V>, it has to be `Object*` or `ObjectSubClass*`. 2013-12-26 21:49:40 +08:00
James Chen 3dba88c5c9 #include <algorithm> for std::find in CCVector.h. 2013-12-20 10:12:07 +08:00
Ricardo Quesada 59fee6b8d2 replaces std::for_each with for()
replaces `std::for_each` with C++11 `for( : )`
2013-12-19 13:34:41 -08:00
James Chen 3829f841e7 Small fix for Vector::insert(const Vector<T>& other), renames it to Vector::pushBack(const Vector<T>& other). 2013-12-17 18:09:07 +08:00
James Chen c85f9877bb Reverts Vector::eraseObject, not need to return iterator. 2013-12-17 17:54:38 +08:00
James Chen d16fa07661 Removes Vector<T>::forEach, please use std::for_each instead. The same as Vector<T>::sort. 2013-12-17 17:45:29 +08:00
minggo 16efe94946 fix compiling error after fixing conflicts 2013-12-12 14:48:27 +08:00
minggo 1e9c763b40 use ssize_t for index and capacity 2013-12-12 14:48:26 +08:00
minggo ab23b47043 use ssize_t for capacity and index in containers 2013-12-12 14:48:26 +08:00
James Chen 93bd45cefd issue #2790: Adds comments for Vector<T>.
Signed-off-by: James Chen <jianhua.chen@cocos2d-x.org>
2013-12-12 14:22:49 +08:00
James Chen ce61fa4d9b issue #2790: const_iterator —> iterator to fix android build errors. 2013-12-11 22:09:22 +08:00
James Chen 36fd873257 issue #2790: Adds Vector::find. 2013-12-11 18:08:07 +08:00
James Chen 093e310cab issue #2790: Vector::remove —> Vector::erase. 2013-12-11 18:08:06 +08:00
Dhilan007 abef5b59fa fix compile error for vs project 2013-12-10 21:20:52 +08:00
boyu0 698cdc5591 add std::move to Vector move constructor and move equal operator overloading function. 2013-12-10 15:58:13 +08:00
James Chen 6f13a111ae issue #2790: Adds Vector<T>::sort method, adds Vector::removeObject(object, toRemoved). 2013-12-07 14:18:42 +08:00
James Chen 23ad9f4e1a issue #2790: Adds const version of Vector<T>::forEach. 2013-12-07 10:46:40 +08:00
minggo fa7c97171b fix some warnings 2013-12-06 16:32:06 +08:00
minggo 9676821479 use int in Vector 2013-12-05 17:38:08 +08:00
James Chen 2b857ebb52 Fixing compilation errors on windows. 2013-12-05 16:09:38 +08:00
James Chen 499a0404d4 issue #2790: Renames some functions in Vector<T>. Makes it more like stl vector. 2013-12-05 10:35:10 +08:00
James Chen 293ba0210b issue #2790: CCLOG —> CCLOGINFO for CCMap.h and CCVector.h 2013-12-04 16:37:08 +08:00
James Chen 35b96602d3 issue #2790: includes <algorithm> for std::for_each. 2013-12-04 16:02:53 +08:00
James Chen 5eb9446b80 issue #2790: Uses const reference instead of value for std::for_each ’s argument. 2013-12-04 16:02:53 +08:00
James Chen 2d6e6dbdb0 issue #2790: Assert fix for Vector<T>::insertObject. 2013-12-04 16:02:52 +08:00
James Chen 9928e8bef1 issue #2790: Uses Vector<T>::getObjectAtIndex instead of Vector<T>[] operator to avoid some mistakes. 2013-12-04 16:01:55 +08:00
James Chen cb215bc931 issue #2790: Vector<T> replaces Array* finished. 2013-12-04 16:01:55 +08:00
James Chen 8aef092005 issue #2790: TestCpp with new Vector<>. 2013-12-04 16:01:54 +08:00