Michele Caini 8 лет назад
Родитель
Сommit
a67a2e12fd
3 измененных файлов с 8 добавлено и 8 удалено
  1. 3 3
      src/entt/entity/view.hpp
  2. 3 3
      src/entt/signal/dispatcher.hpp
  3. 2 2
      src/entt/signal/emitter.hpp

+ 3 - 3
src/entt/entity/view.hpp

@@ -227,7 +227,7 @@ public:
      */
     template<typename Func>
     void each(Func func) {
-        const_cast<const PersistentView *>(this)->each([&func](auto entity, const Component &... component) {
+        const_cast<const PersistentView *>(this)->each([&func](entity_type entity, const Component &... component) {
             func(entity, const_cast<Component &>(component)...);
         });
     }
@@ -497,7 +497,7 @@ public:
      */
     template<typename Func>
     void each(Func func) {
-        const_cast<const View *>(this)->each([&func](auto entity, const Component &... component) {
+        const_cast<const View *>(this)->each([&func](entity_type entity, const Component &... component) {
             func(entity, const_cast<Component &>(component)...);
         });
     }
@@ -752,7 +752,7 @@ public:
      */
     template<typename Func>
     void each(Func func) {
-        const_cast<const View *>(this)->each([&func](auto entity, const Component &component) {
+        const_cast<const View *>(this)->each([&func](entity_type entity, const Component &component) {
             func(entity, const_cast<Component &>(component));
         });
     }

+ 3 - 3
src/entt/signal/dispatcher.hpp

@@ -41,7 +41,7 @@ class Dispatcher final {
     template<typename Event>
     struct SignalWrapper final: BaseSignalWrapper {
         void publish(std::size_t current) override {
-            for(auto &&event: events[current]) {
+            for(const auto &event: events[current]) {
                 signal.publish(event);
             }
 
@@ -79,7 +79,7 @@ class Dispatcher final {
 
     template<typename Event>
     SignalWrapper<Event> & wrapper() {
-        auto type = event_family::type<Event>();
+        const auto type = event_family::type<Event>();
 
         if(!(type < wrappers.size())) {
             wrappers.resize(type + 1);
@@ -178,7 +178,7 @@ public:
      * to reduce at a minimum the time spent in the bodies of the listeners.
      */
     void update() {
-        auto buf = buffer(mode);
+        const auto buf = buffer(mode);
         mode = !mode;
 
         for(auto &&wrapper: wrappers) {

+ 2 - 2
src/entt/signal/emitter.hpp

@@ -124,7 +124,7 @@ class Emitter {
 
     template<typename Event>
     Handler<Event> & handler() noexcept {
-        std::size_t family = type<Event>();
+        const std::size_t family = type<Event>();
 
         if(!(family < handlers.size())) {
             handlers.resize(family+1);
@@ -314,7 +314,7 @@ public:
      */
     template<typename Event>
     bool empty() const noexcept {
-        std::size_t family = type<Event>();
+        const std::size_t family = type<Event>();
 
         return (!(family < handlers.size()) ||
                 !handlers[family] ||