diff --git a/src/modules/uORB/uORBManager.cpp b/src/modules/uORB/uORBManager.cpp index a6d2a2a8e3..63cecba4a6 100644 --- a/src/modules/uORB/uORBManager.cpp +++ b/src/modules/uORB/uORBManager.cpp @@ -137,7 +137,7 @@ int uORB::Manager::orb_exists(const struct orb_metadata *meta, int instance) #else ret = px4_access(path, F_OK); - if (ret == -1 && meta != nullptr && _remote_topics.size() > 0) { + if (ret == -1 && meta != nullptr && !_remote_topics.empty()) { ret = (_remote_topics.find(meta->o_name) != _remote_topics.end()) ? OK : ERROR; } diff --git a/src/platforms/posix/main.cpp b/src/platforms/posix/main.cpp index a18a6bc7e6..cce995afd9 100644 --- a/src/platforms/posix/main.cpp +++ b/src/platforms/posix/main.cpp @@ -226,7 +226,7 @@ static void run_cmd(const vector &appargs, bool exit_on_fail, bool silen } } - } else if (command.compare("help") == 0) { + } else if (command == "help") { list_builtins(apps); } else if (command.length() == 0 || command[0] == '#') { @@ -387,7 +387,7 @@ int main(int argc, char **argv) cout << "commands file: " << commands_file << endl; - if (commands_file.size() < 1) { + if (commands_file.empty()) { PX4_ERR("Error commands file not specified"); return -1; } @@ -452,7 +452,7 @@ int main(int argc, char **argv) px4::init(argc, argv, "px4"); // if commandfile is present, process the commands from the file - if (commands_file.size() != 0) { + if (!commands_file.empty()) { ifstream infile(commands_file.c_str()); if (infile.is_open()) {