neverwinter.nim
neverwinter.nim copied to clipboard
scriptcomp: Avoid needless heap allocs
class CScriptParseTreeNode
{
...
CExoString *m_psStringData;
...
CExoString *m_psTypeName;
...
There's really no need for these to be pointers that are then nullchecked and realloced everywhere. Just embed the strings directly into the class. The string data will be heap-allocated anyway.
You can assign me to this if there's no other takers. If there's someone absolutely losing his mind at the opportunity of moving some strings into a class right away it can be reassigned to them instead.
I'll leave it up for grabs until the PR for #82 is up. Unless you wanna swap with this one.