mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] EditorController: avoid dynamic allocation
This commit is contained in:
@@ -80,14 +80,10 @@ bool EditorController::textAreaDidReceiveEvent(TextArea * textArea, Ion::Events:
|
||||
indentationIndex++;
|
||||
}
|
||||
}
|
||||
char * indentationBuffer = new char [indentationSize+2];
|
||||
indentationBuffer[0] = '\n';
|
||||
textArea->handleEventWithText("\n");
|
||||
for (int i = 0; i < indentationSize; i++) {
|
||||
indentationBuffer[i+1] = ' ';
|
||||
textArea->handleEventWithText(" ");
|
||||
}
|
||||
indentationBuffer[indentationSize+1] = 0;
|
||||
textArea->handleEventWithText(indentationBuffer);
|
||||
delete[] indentationBuffer;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user