summaryrefslogtreecommitdiffstats
path: root/src/gui/LoadGraphWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-10-06 16:32:41 -0400
committerDavid Robillard <d@drobilla.net>2024-10-06 18:40:03 -0400
commit5fe9b2cd3e7ff8f7f23075c980e36d7d456788a8 (patch)
treec62f1bfc0046ae9a952df2e32f5d23c6aed24a6c /src/gui/LoadGraphWindow.cpp
parent45bd400f71e574bfa2670f13f7c1611ab2089903 (diff)
downloadingen-5fe9b2cd3e7ff8f7f23075c980e36d7d456788a8.tar.gz
ingen-5fe9b2cd3e7ff8f7f23075c980e36d7d456788a8.tar.bz2
ingen-5fe9b2cd3e7ff8f7f23075c980e36d7d456788a8.zip
Avoid inefficient use of substr() to set strings to a prefix
Diffstat (limited to 'src/gui/LoadGraphWindow.cpp')
-rw-r--r--src/gui/LoadGraphWindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp
index 794cfe71..b118effb 100644
--- a/src/gui/LoadGraphWindow.cpp
+++ b/src/gui/LoadGraphWindow.cpp
@@ -237,7 +237,7 @@ raul::Symbol
LoadGraphWindow::symbol_from_filename(const Glib::ustring& filename)
{
std::string symbol_str = Glib::path_get_basename(get_filename());
- symbol_str = symbol_str.substr(0, symbol_str.find('.'));
+ symbol_str.resize(symbol_str.find('.'));
return raul::Symbol::symbolify(symbol_str);
}