From a5bbdd6998abc5b0a780880c0ff4e1aa9df77b74 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 7 Mar 2020 00:58:48 +1100 Subject: Cleanup: use ELEM macro for path slash checks --- source/blender/python/intern/bpy_traceback.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index 06d8b645ac7..911e91e9e0f 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -152,8 +152,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset) const char *filename = _PyUnicode_AsString(filename_py); /* python adds a '/', prefix, so check for both */ if ((BLI_path_cmp(filename, filepath) == 0) || - ((filename[0] == '\\' || filename[0] == '/') && - BLI_path_cmp(filename + 1, filepath) == 0)) { + (ELEM(filename[0], '\\', '/') && BLI_path_cmp(filename + 1, filepath) == 0)) { /* good */ } else { @@ -177,7 +176,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset) PyObject *coerce; const char *tb_filepath = traceback_filepath(tb, &coerce); const int match = ((BLI_path_cmp(tb_filepath, filepath) == 0) || - ((tb_filepath[0] == '\\' || tb_filepath[0] == '/') && + (ELEM(tb_filepath[0], '\\', '/') && BLI_path_cmp(tb_filepath + 1, filepath) == 0)); Py_DECREF(coerce); -- cgit v1.2.3