Made sourceLine argument optional to avoid string allocation

This commit is contained in:
smallmodel committed 2023-08-19 21:12:03 +02:00
1 parent 50cfc7e5ad
commit a307450e17
3 files changed
+8 -7

No files matched your search

+1 -2
View File
@@ -847,12 +847,11 @@ void ScriptCompiler::EmitOpcode(int opcode, unsigned int sourcePos)
}
if (script->m_ProgToSource) {
str sourceLine;
sourceinfo_t info;
info.sourcePos = sourcePos;
script->GetSourceAt(sourcePos, sourceLine, info.column, info.line);
script->GetSourceAt(sourcePos, NULL, info.column, info.line);
script->m_ProgToSource->addKeyValue(code_pos) = info;
}