Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-03-06 16:58:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-06 17:02:37 +0300
commita5bbdd6998abc5b0a780880c0ff4e1aa9df77b74 (patch)
treeedebab603fc8a037ce9ed585b284db067a381bcd /source/blender/python
parentb4f1edd98b96d379c196786a75d05a4decac2d5e (diff)
Cleanup: use ELEM macro for path slash checks
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_traceback.c5
1 files changed, 2 insertions, 3 deletions
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);