Răsfoiți Sursa

organizer: minor changes

Michele Caini 3 ani în urmă
părinte
comite
c36d5e4a9c
1 a modificat fișierele cu 7 adăugiri și 9 ștergeri
  1. 7 9
      src/entt/entity/organizer.hpp

+ 7 - 9
src/entt/entity/organizer.hpp

@@ -171,16 +171,14 @@ class basic_organizer final {
                     if(auto curr = it++; it != last) {
                         if(it->second) {
                             edges[curr->first * length + it->first] = true;
+                        } else if(const auto next = std::find_if(it, last, [](const auto &elem) { return elem.second; }); next != last) {
+                            for(; it != next; ++it) {
+                                edges[curr->first * length + it->first] = true;
+                                edges[it->first * length + next->first] = true;
+                            }
                         } else {
-                            if(const auto next = std::find_if(it, last, [](const auto &elem) { return elem.second; }); next != last) {
-                                for(; it != next; ++it) {
-                                    edges[curr->first * length + it->first] = true;
-                                    edges[it->first * length + next->first] = true;
-                                }
-                            } else {
-                                for(; it != next; ++it) {
-                                    edges[curr->first * length + it->first] = true;
-                                }
+                            for(; it != next; ++it) {
+                                edges[curr->first * length + it->first] = true;
                             }
                         }
                     }