diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-03 14:53:04 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-03 15:00:36 +0200 |
commit | 1ef10744abfac64583c793080ef678ac2575a5b1 (patch) | |
tree | 31927f94e66b74b995e17f86320ff3ac80006832 | |
parent | a736a2cbc469da837ddfb3a95368b5e556e12017 (diff) | |
download | mariadb-git-1ef10744abfac64583c793080ef678ac2575a5b1.tar.gz |
MDEV-21534: Fix -Wmaybe-uninitialized
group_commit_lock::release(): Ensure that prev will be initialized,
simplify a comparison, and fix some white space.
-rw-r--r-- | storage/innobase/log/log0sync.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/storage/innobase/log/log0sync.cc b/storage/innobase/log/log0sync.cc index cbac3692f26..563b178e427 100644 --- a/storage/innobase/log/log0sync.cc +++ b/storage/innobase/log/log0sync.cc @@ -261,14 +261,14 @@ void group_commit_lock::release(value_type num) group_commit_waiter_t* wakeup_list = nullptr; int extra_wake = 0; - for (cur = m_waiters_list; cur; cur = next) + for (prev= nullptr, cur= m_waiters_list; cur; cur= next) { - next = cur->m_next; + next= cur->m_next; if (cur->m_value <= num || extra_wake++ == 0) { /* Move current waiter to wakeup_list*/ - if (cur == m_waiters_list) + if (!prev) { /* Remove from the start of the list.*/ m_waiters_list = next; @@ -276,7 +276,7 @@ void group_commit_lock::release(value_type num) else { /* Remove from the middle of the list.*/ - prev->m_next = cur->m_next; + prev->m_next= cur->m_next; } /* Append entry to the wakeup list.*/ @@ -285,14 +285,14 @@ void group_commit_lock::release(value_type num) } else { - prev = cur; + prev= cur; } } lk.unlock(); - for (cur = wakeup_list; cur; cur = next) + for (cur= wakeup_list; cur; cur= next) { - next = cur->m_next; + next= cur->m_next; cur->m_sema.wake(); } } |