mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +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: https://github.com/SerenityOS/serenity/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;
|
||||
while (true) {
|
||||
result = try_enqueue(to_insert);
|
||||
|
||||
if (result.is_error()) {
|
||||
if (result.error() == QueueStatus::Full)
|
||||
wait_function();
|
||||
else
|
||||
return Error::from_string_literal("Unexpected error while enqueuing"sv);
|
||||
} else {
|
||||
if (!result.is_error())
|
||||
break;
|
||||
}
|
||||
if (result.error() != QueueStatus::Full)
|
||||
return Error::from_string_literal("Unexpected error while enqueuing"sv);
|
||||
|
||||
wait_function();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue