Skip to content

Commit 674fd54

Browse files
remove some extra braces
1 parent b7e9e07 commit 674fd54

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

libc/src/__support/aba_ptr.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,15 @@ template <class T, bool IsAtomic> struct AbaPtrImpl {
4545
// Wrapping add for unsigned integers.
4646
next.tag = snapshot.tag + 1;
4747
if (__atomic_compare_exchange(&impl.atomic, &snapshot, &next, true,
48-
__ATOMIC_ACQ_REL, __ATOMIC_RELAXED)) {
48+
__ATOMIC_ACQ_REL, __ATOMIC_RELAXED))
4949
return;
50-
}
5150
}
5251
} else {
5352
// Acquire the lock.
54-
while (__atomic_exchange_n(&impl.mutex.locked, true, __ATOMIC_ACQUIRE)) {
55-
while (__atomic_load_n(&impl.mutex.locked, __ATOMIC_RELAXED)) {
53+
while (__atomic_exchange_n(&impl.mutex.locked, true, __ATOMIC_ACQUIRE))
54+
while (__atomic_load_n(&impl.mutex.locked, __ATOMIC_RELAXED))
5655
LIBC_NAMESPACE::sleep_briefly();
57-
}
58-
}
56+
5957
impl.mutex.ptr = op(impl.mutex.ptr);
6058
// Release the lock.
6159
__atomic_store_n(&impl.mutex.locked, false, __ATOMIC_RELEASE);

libc/src/__support/mpmc_stack.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ template <class T> class MPMCStack {
3232
LIBC_INLINE bool push(T value) {
3333
AllocChecker ac;
3434
Node *new_node = new Node(value, ac);
35-
if (!ac) {
35+
if (!ac)
3636
return false;
37-
}
3837
head.transaction([new_node](Node *old_head) {
3938
new_node->next = old_head;
4039
return new_node;

0 commit comments

Comments
 (0)