Cleanup: use ELEM macro for path slash checks
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user