From 3283bca45475a597686378f232b65d052422c6b8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 19:23:48 +0100 Subject: Cleanup: Use faster char overload of find_last_of() --- src/ClashAvoider.cpp | 2 +- src/Parser.cpp | 2 +- src/server/LV2Plugin.cpp | 2 +- src/server/SocketListener.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp index 1c1e4db1..83aefddd 100644 --- a/src/ClashAvoider.cpp +++ b/src/ClashAvoider.cpp @@ -99,7 +99,7 @@ ClashAvoider::map_path(const Raul::Path& in) offset = ++o->second; } else { std::string parent_str = in.parent().base(); - parent_str = parent_str.substr(0, parent_str.find_last_of("/")); + parent_str = parent_str.substr(0, parent_str.find_last_of('/')); if (parent_str.empty()) { parent_str = "/"; } diff --git a/src/Parser.cpp b/src/Parser.cpp index c4661789..631d5cf4 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -181,7 +181,7 @@ get_port(ingen::World& world, sym = s->second.ptr(); } else { const std::string subject_str = subject.to_string(); - const size_t last_slash = subject_str.find_last_of("/"); + const size_t last_slash = subject_str.find_last_of('/'); sym = ((last_slash == std::string::npos) ? subject_str diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index 983f566c..b3aa392c 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -74,7 +74,7 @@ LV2Plugin::symbol() const } while (working.length() > 0) { - size_t last_slash = working.find_last_of("/"); + size_t last_slash = working.find_last_of('/'); const std::string symbol = working.substr(last_slash+1); if ( (symbol[0] >= 'a' && symbol[0] <= 'z') || (symbol[0] >= 'A' && symbol[0] <= 'Z') ) { diff --git a/src/server/SocketListener.cpp b/src/server/SocketListener.cpp index 0853962b..ecce1649 100644 --- a/src/server/SocketListener.cpp +++ b/src/server/SocketListener.cpp @@ -98,7 +98,7 @@ ingen_listen(Engine* engine, Raul::Socket* unix_sock, Raul::Socket* net_sock) } else { const std::string old_path = get_link_target(link_path.c_str()); if (!old_path.empty()) { - const std::string suffix = old_path.substr(old_path.find_last_of(".") + 1); + const std::string suffix = old_path.substr(old_path.find_last_of('.') + 1); const pid_t pid = std::stoi(suffix); if (!kill(pid, 0)) { make_link = false; -- cgit v1.2.1