From 88dff1aabd3c81d1d81ac256e0061b98e0d24cec Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 18:15:35 +0100 Subject: Cleanup: Use empty() instead of size() where appropriate --- src/ClashAvoider.cpp | 2 +- src/gui/ConnectWindow.cpp | 2 +- src/gui/GraphTreeWindow.cpp | 2 +- src/gui/LoadGraphWindow.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp index 4dc8c64d..1c1e4db1 100644 --- a/src/ClashAvoider.cpp +++ b/src/ClashAvoider.cpp @@ -113,7 +113,7 @@ ClashAvoider::map_path(const Raul::Path& in) ss << base_path << "_" << offset; if (!exists(Raul::Path(ss.str()))) { std::string name = base_path.symbol(); - if (name == "") { + if (name.empty()) { name = "_"; } Raul::Symbol sym(name); diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 232b5e20..209475e0 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -526,7 +526,7 @@ ConnectWindow::gtk_callback() _app->interface()->get(URI(main_uri().string() + "/")); next_stage(); } else if (_connect_stage == 4) { - if (_app->store()->size() > 0) { + if (!_app->store()->empty()) { SPtr root = dynamic_ptr_cast( _app->store()->object(Raul::Path("/"))); if (root) { diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp index 5046eac9..68f6e392 100644 --- a/src/gui/GraphTreeWindow.cpp +++ b/src/gui/GraphTreeWindow.cpp @@ -139,7 +139,7 @@ GraphTreeWindow::find_graph(Gtk::TreeModel::Children root, SPtr pm = (*c)[_graph_tree_columns.graph_model_col]; if (graph == pm) { return c; - } else if ((*c)->children().size() > 0) { + } else if (!(*c)->children().empty()) { Gtk::TreeModel::iterator ret = find_graph(c->children(), graph); if (ret != c->children().end()) { return ret; diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp index e3588ddf..62c68b04 100644 --- a/src/gui/LoadGraphWindow.cpp +++ b/src/gui/LoadGraphWindow.cpp @@ -163,7 +163,7 @@ LoadGraphWindow::ok_clicked() _app->forge().make(_poly_spinbutton->get_value_as_int())); } - if (get_uri() == "") { + if (get_uri().empty()) { return; } @@ -189,7 +189,7 @@ LoadGraphWindow::ok_clicked() y = _app->forge().make(y.get() + 20.0f); Raul::Symbol symbol(symbol_from_filename(u)); - if (uri_list.size() == 1 && _symbol_entry->get_text() != "") { + if (uri_list.size() == 1 && !_symbol_entry->get_text().empty()) { symbol = Raul::Symbol::symbolify(_symbol_entry->get_text()); } -- cgit v1.2.1