From 3af246bb3291d8568f6d110884fa55ee5fd20221 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Aug 2022 01:22:18 -0400 Subject: Avoid "else" after "return", "break", and "continue" --- src/client/ClientStore.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/client/ClientStore.cpp') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 9728cc4f..80143265 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -168,12 +168,12 @@ ClientStore::_object(const raul::Path& path) const auto i = find(path); if (i == end()) { return nullptr; - } else { - auto model = std::dynamic_pointer_cast(i->second); - assert(model); - assert(model->path().is_root() || model->parent()); - return model; } + + auto model = std::dynamic_pointer_cast(i->second); + assert(model); + assert(model->path().is_root() || model->parent()); + return model; } std::shared_ptr @@ -187,9 +187,9 @@ ClientStore::_resource(const URI& uri) { if (uri_is_path(uri)) { return _object(uri_to_path(uri)); - } else { - return _plugin(uri); } + + return _plugin(uri); } std::shared_ptr @@ -281,7 +281,9 @@ ClientStore::operator()(const Put& msg) plug->add_preset(uri, l->second.ptr()); } return; - } else if (_uris.ingen_Graph == type) { + } + + if (_uris.ingen_Graph == type) { is_graph = true; } else if (_uris.ingen_Internal == type || _uris.lv2_Plugin == type) { std::shared_ptr p(new PluginModel(uris(), uri, type, properties)); @@ -452,10 +454,10 @@ ClientStore::attempt_connection(const raul::Path& tail_path, std::shared_ptr arc(new ArcModel(tail, head)); graph->add_arc(arc); return true; - } else { - _log.warn("Failed to connect %1% => %2%\n", tail_path, head_path); - return false; } + + _log.warn("Failed to connect %1% => %2%\n", tail_path, head_path); + return false; } void -- cgit v1.2.1