소스 검색

organizer: minor changes

Michele Caini 3 년 전
부모
커밋
c36d5e4a9c
1개의 변경된 파일7개의 추가작업 그리고 9개의 파일을 삭제
  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;
                             }
                         }
                     }