Skip to content

Commit

Permalink
replace while loop with for range.
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Nov 1, 2022
1 parent dc5dc0d commit e9adb54
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4985,11 +4985,8 @@ void XmpProperties::unregisterNsUnsafe(const std::string& ns) {
void XmpProperties::unregisterNs() {
auto scoped_write_lock = std::scoped_lock(mutex_);
/// \todo check if we are not unregistering the first NS
auto i = nsRegistry_.begin();
while (i != nsRegistry_.end()) {
auto kill = i++;
unregisterNsUnsafe(kill->first);
}
for (const auto& k : nsRegistry_)
unregisterNsUnsafe(k.first);
}

std::string XmpProperties::prefix(const std::string& ns) {
Expand Down

0 comments on commit e9adb54

Please sign in to comment.