mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibCore: Simplify conditional logic in SharedCircularQueue
No functional changes.
This commit is contained in:
parent
581e4dc25b
commit
50cf4e6e64
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
Add a link
Reference in a new issue