Simplify Boolean expressions
This patch simplifies boolean expressions acorss LLDB. It was generated
using clang-tidy with the following command:
run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD
Differential revision: https://reviews.llvm.org/D55584
llvm-svn: 349215
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 0ed2d4a..1072b44 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -987,16 +987,16 @@
if (!name.empty()) {
// do not allow replacement of internal commands
if (CommandExists(name)) {
- if (can_replace == false)
+ if (!can_replace)
return false;
- if (m_command_dict[name]->IsRemovable() == false)
+ if (!m_command_dict[name]->IsRemovable())
return false;
}
if (UserCommandExists(name)) {
- if (can_replace == false)
+ if (!can_replace)
return false;
- if (m_user_dict[name]->IsRemovable() == false)
+ if (!m_user_dict[name]->IsRemovable())
return false;
}
@@ -2131,7 +2131,7 @@
profilePath.AppendPathComponent(".lldbinit");
std::string init_file_path = profilePath.GetPath();
- if (m_skip_app_init_files == false) {
+ if (!m_skip_app_init_files) {
FileSpec program_file_spec(HostInfo::GetProgramFileSpec());
const char *program_name = program_file_spec.GetFilename().AsCString();
@@ -2769,7 +2769,7 @@
return;
const bool is_interactive = io_handler.GetIsInteractive();
- if (is_interactive == false) {
+ if (!is_interactive) {
// When we are not interactive, don't execute blank lines. This will happen
// sourcing a commands file. We don't want blank lines to repeat the
// previous command and cause any errors to occur (like redefining an
@@ -3018,8 +3018,7 @@
bool is_alias = GetAliasFullName(next_word, full_name);
cmd_obj = GetCommandObject(next_word, &matches);
bool is_real_command =
- (is_alias == false) ||
- (cmd_obj != nullptr && cmd_obj->IsAlias() == false);
+ (!is_alias) || (cmd_obj != nullptr && !cmd_obj->IsAlias());
if (!is_real_command) {
matches.Clear();
std::string alias_result;