forgottenserver
forgottenserver copied to clipboard
Replace virtual functions with static_cast
Pull Request Prelude
- [x] I have followed proper The Forgotten Server code styling.
- [x] I have read and understood the contribution guidelines before making this PR.
- [x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
- Change for static_cast on conversion is guaranteed.
You'll need to rebase and reformat the files
what is the context for this pull request? performance gain? resolving potential crashes? code cleanup?
what is the context for this pull request? performance gain? resolving potential crashes? code cleanup?
It saves one virtual function call - which cannot be inlined because the function address cannot be determined in compile time, while static_cast is free - when we are sure that the conversion is valid.
Is this alive? Rebase needed.