Optimization to reduce almost to zero allocations during frame rendering in ecode (this gives around 6% perf gains).

This commit is contained in:
Martín Lucas Golini
2024-10-29 02:11:33 -03:00
parent cac43d0276
commit 0e0ce71609
15 changed files with 337 additions and 203 deletions

View File

@@ -1905,12 +1905,9 @@ void LSPClientPlugin::drawTop( UICodeEditor* editor, const Vector2f& screenStart
Float fontSize = editor->getUISceneNode()->getUIThemeManager()->getDefaultFontSize();
bool isPath = true;
std::string path( editor->getDocument().getFilePath() );
if ( path.empty() ) {
path = editor->getDocument().getFilename();
isPath = false;
}
bool isPath = !editor->getDocument().getFilePath().empty();
std::string path( !isPath ? editor->getDocument().getFilename()
: editor->getDocument().getFilePath() );
Color textColor( editor->getColorScheme().getEditorColor(
mHoveringBreadcrumb == editor ? SyntaxStyleTypes::Text : SyntaxStyleTypes::LineNumber2 ) );