From de8b5de7b498e9f2f6d9749ed218deeb95e55c24 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 15 Oct 2020 18:21:50 +0200 Subject: [PATCH] Mark several classes as final for devirtualization performance benefits. Signed-off-by: Deukhoofd --- src/Battling/EventHooks/Events/AttackUseEvent.hpp | 2 +- src/Battling/EventHooks/Events/ChangeSpeciesEvent.hpp | 2 +- src/Battling/EventHooks/Events/ChangeVariantEvent.hpp | 2 +- src/Battling/EventHooks/Events/DamageEvent.hpp | 2 +- src/Battling/EventHooks/Events/DisplayTextEvent.hpp | 2 +- src/Battling/EventHooks/Events/ExperienceGainEvent.hpp | 2 +- src/Battling/EventHooks/Events/FaintEvent.hpp | 2 +- src/Battling/EventHooks/Events/HealEvent.hpp | 2 +- src/Battling/EventHooks/Events/MissEvent.hpp | 2 +- src/Battling/EventHooks/Events/SwitchEvent.hpp | 2 +- src/Battling/EventHooks/Events/TurnEvents.hpp | 4 ++-- src/Battling/History/HistoryElements/AttackUseHistory.hpp | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Battling/EventHooks/Events/AttackUseEvent.hpp b/src/Battling/EventHooks/Events/AttackUseEvent.hpp index 531c4ce..acff7af 100644 --- a/src/Battling/EventHooks/Events/AttackUseEvent.hpp +++ b/src/Battling/EventHooks/Events/AttackUseEvent.hpp @@ -4,7 +4,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class AttackUseEvent : public EventData { + class AttackUseEvent final : public EventData { ArbUt::BorrowedPtr _attack; public: diff --git a/src/Battling/EventHooks/Events/ChangeSpeciesEvent.hpp b/src/Battling/EventHooks/Events/ChangeSpeciesEvent.hpp index e004279..6782701 100644 --- a/src/Battling/EventHooks/Events/ChangeSpeciesEvent.hpp +++ b/src/Battling/EventHooks/Events/ChangeSpeciesEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class ChangeSpeciesEvent : public EventData { + class ChangeSpeciesEvent final : public EventData { const ArbUt::BorrowedPtr _creature; const ArbUt::BorrowedPtr _newSpecies; diff --git a/src/Battling/EventHooks/Events/ChangeVariantEvent.hpp b/src/Battling/EventHooks/Events/ChangeVariantEvent.hpp index dfbac21..77a144f 100644 --- a/src/Battling/EventHooks/Events/ChangeVariantEvent.hpp +++ b/src/Battling/EventHooks/Events/ChangeVariantEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class ChangeVariantEvent : public EventData { + class ChangeVariantEvent final : public EventData { const ArbUt::BorrowedPtr _creature; const ArbUt::BorrowedPtr _newVariant; diff --git a/src/Battling/EventHooks/Events/DamageEvent.hpp b/src/Battling/EventHooks/Events/DamageEvent.hpp index b583f38..3cb0d23 100644 --- a/src/Battling/EventHooks/Events/DamageEvent.hpp +++ b/src/Battling/EventHooks/Events/DamageEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class DamageEvent : public EventData { + class DamageEvent final : public EventData { ArbUt::BorrowedPtr _creature; DamageSource _damageSource; uint32_t _originalHealth; diff --git a/src/Battling/EventHooks/Events/DisplayTextEvent.hpp b/src/Battling/EventHooks/Events/DisplayTextEvent.hpp index 9beb9ae..0dcf8ff 100644 --- a/src/Battling/EventHooks/Events/DisplayTextEvent.hpp +++ b/src/Battling/EventHooks/Events/DisplayTextEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class DisplayTextEvent : public EventData { + class DisplayTextEvent final : public EventData { const ArbUt::StringView _text; public: diff --git a/src/Battling/EventHooks/Events/ExperienceGainEvent.hpp b/src/Battling/EventHooks/Events/ExperienceGainEvent.hpp index cf9daf9..e05495e 100644 --- a/src/Battling/EventHooks/Events/ExperienceGainEvent.hpp +++ b/src/Battling/EventHooks/Events/ExperienceGainEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class ExperienceGainEvent : public EventData { + class ExperienceGainEvent final : public EventData { ArbUt::BorrowedPtr _creature; uint32_t _previousExperience; uint32_t _newExperience; diff --git a/src/Battling/EventHooks/Events/FaintEvent.hpp b/src/Battling/EventHooks/Events/FaintEvent.hpp index 02152f2..82118a9 100644 --- a/src/Battling/EventHooks/Events/FaintEvent.hpp +++ b/src/Battling/EventHooks/Events/FaintEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class FaintEvent : public EventData { + class FaintEvent final : public EventData { ArbUt::BorrowedPtr _creature; public: diff --git a/src/Battling/EventHooks/Events/HealEvent.hpp b/src/Battling/EventHooks/Events/HealEvent.hpp index e83e270..177848a 100644 --- a/src/Battling/EventHooks/Events/HealEvent.hpp +++ b/src/Battling/EventHooks/Events/HealEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class HealEvent : public EventData { + class HealEvent final : public EventData { ArbUt::BorrowedPtr _creature; uint32_t _originalHealth; uint32_t _newHealth; diff --git a/src/Battling/EventHooks/Events/MissEvent.hpp b/src/Battling/EventHooks/Events/MissEvent.hpp index 4f0330e..d5def64 100644 --- a/src/Battling/EventHooks/Events/MissEvent.hpp +++ b/src/Battling/EventHooks/Events/MissEvent.hpp @@ -3,7 +3,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class MissEvent : public EventData { + class MissEvent final : public EventData { ArbUt::BorrowedPtr _creature; public: diff --git a/src/Battling/EventHooks/Events/SwitchEvent.hpp b/src/Battling/EventHooks/Events/SwitchEvent.hpp index fcf3f87..56a122a 100644 --- a/src/Battling/EventHooks/Events/SwitchEvent.hpp +++ b/src/Battling/EventHooks/Events/SwitchEvent.hpp @@ -4,7 +4,7 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class SwitchEvent : public EventData { + class SwitchEvent final : public EventData { CreatureIndex _index; ArbUt::BorrowedPtr _newCreature; diff --git a/src/Battling/EventHooks/Events/TurnEvents.hpp b/src/Battling/EventHooks/Events/TurnEvents.hpp index cc87d88..94245c4 100644 --- a/src/Battling/EventHooks/Events/TurnEvents.hpp +++ b/src/Battling/EventHooks/Events/TurnEvents.hpp @@ -3,13 +3,13 @@ #include "EventData.hpp" namespace CreatureLib::Battling { - class TurnStartEvent : public EventData { + class TurnStartEvent final : public EventData { public: TurnStartEvent() {} EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnStart; } }; - class TurnEndEvent : public EventData { + class TurnEndEvent final : public EventData { public: TurnEndEvent() {} EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnEnd; } diff --git a/src/Battling/History/HistoryElements/AttackUseHistory.hpp b/src/Battling/History/HistoryElements/AttackUseHistory.hpp index 31f7121..177c1d6 100644 --- a/src/Battling/History/HistoryElements/AttackUseHistory.hpp +++ b/src/Battling/History/HistoryElements/AttackUseHistory.hpp @@ -4,7 +4,7 @@ #include "HistoryElement.hpp" namespace CreatureLib::Battling { - class AttackUseHistory : public HistoryElement { + class AttackUseHistory final : public HistoryElement { std::unique_ptr _attack; protected: