New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better array #3440

Merged
merged 3 commits into from Aug 20, 2013

Conversation

Projects
None yet
2 participants
@ricardoquesada
Contributor

ricardoquesada commented Aug 20, 2013

Adds support for std::vector + RCPtr<Object> in CCArray.

Why would we want it ?
Basically it allow us to make performance tests on CCArray.

Last, but not least, the sideeffect is that now CCArray has a cleaner API.

ah... additionally all getters with the get, were deprecated, and the get version was added.

for (auto c : *children)
{
node = static_cast<Node*>(c);
auto obj = static_cast<Object*>(c);

This comment has been minimized.

@minggo

minggo Aug 20, 2013

Contributor

Don't need to convert to Object*.

@minggo

minggo Aug 20, 2013

Contributor

Don't need to convert to Object*.

{
std::sort(pArray->data->arr, pArray->data->arr + pArray->data->num, less);
std::sort(array->data->arr, array->data->arr + array->data->num, less);

This comment has been minimized.

@minggo

minggo Aug 20, 2013

Contributor

So can only work when using ccArray in Array?

@minggo

minggo Aug 20, 2013

Contributor

So can only work when using ccArray in Array?

This comment has been minimized.

@ricardoquesada

ricardoquesada Aug 20, 2013

Contributor

Apparently the iterator that you added for Array doesn't work with

std::sort( std::begin(*array), std::end(*array), less);

Not sure why :-( ... but that is something that needs to be fixed.

@ricardoquesada

ricardoquesada Aug 20, 2013

Contributor

Apparently the iterator that you added for Array doesn't work with

std::sort( std::begin(*array), std::end(*array), less);

Not sure why :-( ... but that is something that needs to be fixed.

This comment has been minimized.

@minggo

minggo Aug 20, 2013

Contributor

Ok, i will fix it after merging.

@minggo

minggo Aug 20, 2013

Contributor

Ok, i will fix it after merging.

minggo added a commit that referenced this pull request Aug 20, 2013

@minggo minggo merged commit 5e7e5b8 into cocos2d:develop Aug 20, 2013

1 check passed

default The Travis CI build passed
Details

angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 28, 2014

angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 29, 2014

angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 30, 2014

angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment