forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Change return type of getScriptBaseName to string_view

Open ranisalt opened this issue 3 years ago • 0 comments

getScriptBaseName functions exist in event types (Actions, Weapons, etc) and return a constant string referring to the name of the class. It is possible to, instead of returning std::string, return std::string_view which is more lightweight and avoids copying data on every call (a string has to be created, where a string_view will just be a pointer to static data).

Tip: just search for getScriptBaseName, it's very likely that a search and replace is enough. Optionally, move all definitions to cpp files.

ranisalt avatar Apr 03 '22 00:04 ranisalt