Skip to content

Commit 2b8ba99

Browse files
committed
Prev does not need to be initialized
__atomic_load() returns the contents of *ptr in *ret.
1 parent 0241b3b commit 2b8ba99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_atomic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
8989
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired))
9090

9191
static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *obj, bool desired) {
92-
bool prev = false;
92+
bool prev;
9393
__atomic_exchange(&obj->value, &desired, &prev, __ATOMIC_SEQ_CST);
9494
return prev;
9595
}
9696

9797
static zend_always_inline bool zend_atomic_bool_load_ex(const zend_atomic_bool *obj) {
98-
bool prev = false;
98+
bool prev;
9999
__atomic_load(&obj->value, &prev, __ATOMIC_SEQ_CST);
100100
return prev;
101101
}

0 commit comments

Comments
 (0)