summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-15 00:15:33 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-15 00:15:33 +0000
commita6682a413d893bc1ed6190dfadcee806155da66e (patch)
tree326b3a6e484e3a3a3a5087663e1284f9b594f2a8 /lldb/source/Plugins/ScriptInterpreter/Python
parent9d1827331f3f9582fa2ed05913ae4301f2604a19 (diff)
downloadbcm5719-llvm-a6682a413d893bc1ed6190dfadcee806155da66e.tar.gz
bcm5719-llvm-a6682a413d893bc1ed6190dfadcee806155da66e.zip
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
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 45ffd0813d4..7e96dd9893c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -222,9 +222,7 @@ PythonBytes::~PythonBytes() {}
bool PythonBytes::Check(PyObject *py_obj) {
if (!py_obj)
return false;
- if (PyBytes_Check(py_obj))
- return true;
- return false;
+ return PyBytes_Check(py_obj);
}
void PythonBytes::Reset(PyRefType type, PyObject *py_obj) {
@@ -294,9 +292,7 @@ PythonByteArray::~PythonByteArray() {}
bool PythonByteArray::Check(PyObject *py_obj) {
if (!py_obj)
return false;
- if (PyByteArray_Check(py_obj))
- return true;
- return false;
+ return PyByteArray_Check(py_obj);
}
void PythonByteArray::Reset(PyRefType type, PyObject *py_obj) {
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 289607e309a..41cb443d4f1 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -208,7 +208,7 @@ ScriptInterpreterPython::Locker::Locker(ScriptInterpreterPython *py_interpreter,
m_python_interpreter(py_interpreter) {
DoAcquireLock();
if ((on_entry & InitSession) == InitSession) {
- if (DoInitSession(on_entry, in, out, err) == false) {
+ if (!DoInitSession(on_entry, in, out, err)) {
// Don't teardown the session if we didn't init it.
m_teardown_session = false;
}
@@ -2838,7 +2838,7 @@ bool ScriptInterpreterPython::LoadScriptingModule(
bool was_imported = (was_imported_globally || was_imported_locally);
- if (was_imported == true && can_reload == false) {
+ if (was_imported && !can_reload) {
error.SetErrorString("module already imported");
return false;
}
OpenPOWER on IntegriCloud