Skip to content

Commit

Permalink
avoid duplicate names in scope
Browse files Browse the repository at this point in the history
Flagged by `-Wshadow`.

```
cbSet::const_iterator it
std::vector<std::shared_ptr<CallbackRegistry> >::const_iterator it
```

two iterators with the same name in nearby scopes makes it a bit harder to decide which is which. Simply renamed the first one for clarity.
  • Loading branch information
MichaelChirico authored Feb 14, 2022
1 parent 1d1b6a6 commit 84caa3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/callback_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ bool CallbackRegistry::empty() const {
bool CallbackRegistry::due(const Timestamp& time, bool recursive) const {
ASSERT_MAIN_THREAD()
Guard guard(mutex);
cbSet::const_iterator it = queue.begin();
if (!this->queue.empty() && !((*it)->when > time)) {
cbSet::const_iterator cbSet_it = queue.begin();
if (!this->queue.empty() && !((*cbSet_it)->when > time)) {
return true;
}

Expand Down

0 comments on commit 84caa3d

Please sign in to comment.