Skip to content

Commit 51d3444

Browse files
committed
Fix redundancy and a copy
1 parent 58feedc commit 51d3444

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/NodeModding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void NodeModding::handleNode(CCNode* node) {
1717
std::string className = AlphaUtils::Cocos::getClassName(node);
1818
if (m_nodesToModify.contains(className)) {
1919
std::vector<std::pair<int, std::function<void(CCNode*)>>> methods = m_nodesToModify[className];
20-
std::sort(methods.begin(), methods.end(), [](auto left, auto right) {
20+
std::sort(methods.begin(), methods.end(), [](auto& left, auto& right) {
2121
return left.first < right.first;
2222
});
2323

src/hooks/CCObject.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ using namespace AlphaUtils;
99
class $modify(CCObject) {
1010
CCObject* autorelease() {
1111
if (CCNode* node = typeinfo_cast<CCNode*>(this)) {
12-
std::string className = AlphaUtils::Cocos::getClassName(node);
13-
if (NodeModding::get()->getNodesToModify().contains(className)) {
14-
NodeModding::get()->handleNode(node);
15-
}
12+
NodeModding::get()->handleNode(node);
1613
}
1714
return CCObject::autorelease();
1815
}

0 commit comments

Comments
 (0)