Skip to content

Commit

Permalink
Removed usage of auto
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaim committed Oct 5, 2023
1 parent b9dec84 commit 17c50d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/class_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void ClassDB::initialize(GDExtensionInitializationLevel p_level) {

void ClassDB::deinitialize(GDExtensionInitializationLevel p_level) {
std::set<StringName> to_erase;
for (const auto& name : class_register_order) {
for (const StringName& name : class_register_order) {
const ClassInfo &cl = classes[name];

if (cl.level != p_level) {
Expand All @@ -362,7 +362,7 @@ void ClassDB::deinitialize(GDExtensionInitializationLevel p_level) {

internal::gdextension_interface_classdb_unregister_extension_class(internal::library, name._native_ptr());

for (auto method : cl.method_map) {
for (std::pair<const StringName, MethodBind *> method : cl.method_map) {
memdelete(method.second);
}

Expand All @@ -371,8 +371,8 @@ void ClassDB::deinitialize(GDExtensionInitializationLevel p_level) {
}

{
// The following is equivalent to c++20 `std::erase_if(class_register_order, [&](const auto& name){ return to_erase.contains(name); });`
auto it = std::remove_if(class_register_order.begin(), class_register_order.end(), [&](const StringName& name) {
// The following is equivalent to c++20 `std::erase_if(class_register_order, [&](const StringName& name){ return to_erase.contains(name); });`
std::vector<StringName>::iterator it = std::remove_if(class_register_order.begin(), class_register_order.end(), [&](const StringName& name) {
return to_erase.count(name) > 0;
});
class_register_order.erase(it, class_register_order.end());
Expand Down

0 comments on commit 17c50d3

Please sign in to comment.