mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +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;
|
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