diff options
| author | Filipe Cabecinhas <me@filcab.net> | 2012-08-28 13:49:02 +0000 |
|---|---|---|
| committer | Filipe Cabecinhas <me@filcab.net> | 2012-08-28 13:49:02 +0000 |
| commit | 46f127ac9e7911a967451e68f4bb246deb3b5d9d (patch) | |
| tree | 84390cbbbb2a63a49de0d2f0d45081f0fc99da7f /lldb/scripts/Python | |
| parent | ee92877f17aefcad752b8adc7b2e1dadc1d956e2 (diff) | |
| download | bcm5719-llvm-46f127ac9e7911a967451e68f4bb246deb3b5d9d.tar.gz bcm5719-llvm-46f127ac9e7911a967451e68f4bb246deb3b5d9d.zip | |
Simplify the typecheck code.
llvm-svn: 162753
Diffstat (limited to 'lldb/scripts/Python')
| -rw-r--r-- | lldb/scripts/Python/python-typemaps.swig | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig index 563c9e98921..596b85195aa 100644 --- a/lldb/scripts/Python/python-typemaps.swig +++ b/lldb/scripts/Python/python-typemaps.swig @@ -369,11 +369,8 @@ } %typemap(typecheck) (lldb::SBInputReader::Callback callback, void *baton) { - if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) { - $1 = 0; - } else { - $1 = 1; - } + $1 = $input == Py_None; + $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input)); } // For Log::LogOutputCallback @@ -395,11 +392,8 @@ } %typemap(typecheck) (lldb::LogOutputCallback log_callback, void *baton) { - if (!($input == Py_None || PyCallable_Check(reinterpret_cast<PyObject*>($input)))) { - $1 = 0; - } else { - $1 = 1; - } + $1 = $input == Py_None; + $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject*>($input)); } %typemap(in) FILE * { |

