From 5fe9b2cd3e7ff8f7f23075c980e36d7d456788a8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 6 Oct 2024 16:32:41 -0400 Subject: Avoid inefficient use of substr() to set strings to a prefix --- src/server/LV2Plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/LV2Plugin.cpp') 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"); -- cgit v1.2.1