forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Replace virtual functions with static_cast

Open ramon-bernardo opened this issue 3 years ago • 4 comments

Pull Request Prelude

Changes Proposed

  • Change for static_cast on conversion is guaranteed.

ramon-bernardo avatar Apr 02 '22 14:04 ramon-bernardo

You'll need to rebase and reformat the files

ranisalt avatar Apr 16 '22 19:04 ranisalt

what is the context for this pull request? performance gain? resolving potential crashes? code cleanup?

Zbizu avatar Apr 16 '22 21:04 Zbizu

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.

ranisalt avatar Apr 17 '22 21:04 ranisalt

Is this alive? Rebase needed.

DSpeichert avatar May 17 '22 23:05 DSpeichert