mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibCore: Simplify conditional logic in SharedCircularQueue
No functional changes.
This commit is contained in:
parent
581e4dc25b
commit
50cf4e6e64
Notes:
sideshowbarker
2024-07-17 11:28:27 +09:00
Author: https://github.com/gmta
Commit: 50cf4e6e64
Pull-request: https://github.com/SerenityOS/serenity/pull/13820
Reviewed-by: https://github.com/kennethmyhra ✅
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 5 additions and 8 deletions
|
@ -115,15 +115,12 @@ public:
|
||||||
ErrorOr<void, QueueStatus> result;
|
ErrorOr<void, QueueStatus> result;
|
||||||
while (true) {
|
while (true) {
|
||||||
result = try_enqueue(to_insert);
|
result = try_enqueue(to_insert);
|
||||||
|
if (!result.is_error())
|
||||||
if (result.is_error()) {
|
|
||||||
if (result.error() == QueueStatus::Full)
|
|
||||||
wait_function();
|
|
||||||
else
|
|
||||||
return Error::from_string_literal("Unexpected error while enqueuing"sv);
|
|
||||||
} else {
|
|
||||||
break;
|
break;
|
||||||
}
|
if (result.error() != QueueStatus::Full)
|
||||||
|
return Error::from_string_literal("Unexpected error while enqueuing"sv);
|
||||||
|
|
||||||
|
wait_function();
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue