diff options
author | David Robillard <d@drobilla.net> | 2024-10-06 16:32:41 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-10-06 18:40:03 -0400 |
commit | 5fe9b2cd3e7ff8f7f23075c980e36d7d456788a8 (patch) | |
tree | c62f1bfc0046ae9a952df2e32f5d23c6aed24a6c /src/server | |
parent | 45bd400f71e574bfa2670f13f7c1611ab2089903 (diff) | |
download | ingen-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/server')
-rw-r--r-- | src/server/LV2Plugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index ff571d0b..e304e9c0 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -71,7 +71,7 @@ LV2Plugin::symbol() const { std::string working = uri(); if (working.back() == '/') { - working = working.substr(0, working.length() - 1); + working.resize(working.length() - 1); } while (!working.empty()) { @@ -82,7 +82,7 @@ LV2Plugin::symbol() const return raul::Symbol::symbolify(symbol); } - working = working.substr(0, last_slash); + working.resize(last_slash); } return raul::Symbol("lv2_symbol"); |