mirror of https://github.com/axmolengine/axmol.git
fix, replace std::sort by std::stable_sort (#16092)
* fix, replace std::sort by std::stable_sort
This commit is contained in:
parent
9f09349fa9
commit
c0e0931838
|
@ -1140,7 +1140,7 @@ void Node::sortAllChildren()
|
|||
{
|
||||
if (_reorderChildDirty)
|
||||
{
|
||||
std::sort(std::begin(_children), std::end(_children), nodeComparisonLess);
|
||||
std::stable_sort(std::begin(_children), std::end(_children), nodeComparisonLess);
|
||||
_reorderChildDirty = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,7 +252,7 @@ void ProtectedNode::insertProtectedChild(cocos2d::Node *child, int z)
|
|||
void ProtectedNode::sortAllProtectedChildren()
|
||||
{
|
||||
if( _reorderProtectedChildDirty ) {
|
||||
std::sort( std::begin(_protectedChildren), std::end(_protectedChildren), nodeComparisonLess );
|
||||
std::stable_sort( std::begin(_protectedChildren), std::end(_protectedChildren), nodeComparisonLess );
|
||||
_reorderProtectedChildDirty = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue