Kernel: Use range-for with InlineLinkedList

This commit is contained in:
Andreas Kling 2019-08-08 13:40:58 +02:00
commit 9104d32341
Notes: sideshowbarker 2024-07-19 12:49:09 +09:00
6 changed files with 21 additions and 21 deletions

View file

@ -15,13 +15,13 @@ static Lockable<InlineLinkedList<Custody>>& all_custodies()
Custody* Custody::get_if_cached(Custody* parent, const String& name)
{
LOCKER(all_custodies().lock());
for (auto* custody = all_custodies().resource().head(); custody; custody = custody->next()) {
if (custody->is_deleted())
for (auto& custody : all_custodies().resource()) {
if (custody.is_deleted())
continue;
if (custody->is_mounted_on())
if (custody.is_mounted_on())
continue;
if (custody->parent() == parent && custody->name() == name)
return custody;
if (custody.parent() == parent && custody.name() == name)
return &custody;
}
return nullptr;
}