Skip to content

Commit

Permalink
Remove unnecessary NULL check, add uint32_t cast
Browse files Browse the repository at this point in the history
  • Loading branch information
swtaarrs committed Feb 15, 2024
1 parent 0db460e commit 0e1055f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions Python/ceval_gil.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ update_eval_breaker_for_thread(PyInterpreterState *interp, PyThreadState *tstate
return;
#endif

if (tstate == NULL) {
return;
}

int32_t calls_to_do = _Py_atomic_load_int32_relaxed(
&interp->ceval.pending.calls_to_do);
if (calls_to_do) {
Expand Down
3 changes: 2 additions & 1 deletion Python/instrumentation.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,8 @@ static inline int most_significant_bit(uint8_t bits) {
static uint32_t
global_version(PyInterpreterState *interp)
{
return _Py_atomic_load_uintptr_relaxed(&interp->ceval.instrumentation_version);
return (uint32_t)_Py_atomic_load_uintptr_relaxed(
&interp->ceval.instrumentation_version);
}

/* Atomically set the given version in the given location, without touching
Expand Down

0 comments on commit 0e1055f

Please sign in to comment.