neverwinter.nim icon indicating copy to clipboard operation
neverwinter.nim copied to clipboard

scriptcomp: Avoid needless heap allocs

Open mtijanic opened this issue 1 year ago • 2 comments

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.

mtijanic avatar Jul 17 '23 10:07 mtijanic

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.

fvinke avatar Jul 17 '23 10:07 fvinke

I'll leave it up for grabs until the PR for #82 is up. Unless you wanna swap with this one.

mtijanic avatar Jul 17 '23 11:07 mtijanic