Skip to content

Commit 00e1eab

Browse files
committed
Use parentheses to better group conditions
1 parent b4367af commit 00e1eab

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/scorepy/cInstrumenter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PyObject* CInstrumenter::operator()(PyFrameObject& frame, const char* what_strin
4141
{
4242
const auto it_what = std::find(WHAT_STRINGS.begin(), WHAT_STRINGS.end(), what_string);
4343
const int what =
44-
it_what == WHAT_STRINGS.end() ? -1 : std::distance(WHAT_STRINGS.begin(), it_what);
44+
(it_what == WHAT_STRINGS.end()) ? -1 : std::distance(WHAT_STRINGS.begin(), it_what);
4545
// To speed up further event processing install this class directly as the handler
4646
// But we might be inside a `sys.settrace` call where the user wanted to set another function
4747
// which would then be overwritten here. Hence use the CALL event which avoids the problem

src/scorepy/pythonHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const char* get_module_name(const PyFrameObject& frame)
1212
// this is a NUMPY special situation, see NEP-18, and Score-P issue #63
1313
// TODO: Use string_view/C-String to avoid creating 2 std::strings
1414
const char* filename = PyUnicode_AsUTF8(frame.f_code->co_filename);
15-
if (filename && std::string(filename) == "<__array_function__ internals>")
15+
if (filename && (std::string(filename) == "<__array_function__ internals>"))
1616
return "numpy.__array_function__";
1717
else
1818
return "unkown";

0 commit comments

Comments
 (0)