1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 17:34:03 +00:00

Revert unwanted if-else simplification

This commit is contained in:
Mark 2024-12-29 21:22:12 +01:00
parent ce30f3c189
commit fabc09a16b
No known key found for this signature in database
GPG key ID: 79CFF7869BD39873
2 changed files with 13 additions and 17 deletions

View file

@ -48,17 +48,15 @@ trait ParallelCommand
if ($pid === -1) {
return -1;
}
if ($pid) {
} elseif ($pid) {
// Parent
return $pid;
} else {
// Child
DB::reconnect();
exit($this->childHandle(...$args) ? 0 : 1);
}
// Child
DB::reconnect();
exit($this->childHandle(...$args) ? 0 : 1);
}
protected function sysctlGetLogicalCoreCount(bool $darwin): int
@ -72,9 +70,7 @@ trait ParallelCommand
// perflevel0 refers to P-cores on M-series, and the entire CPU on Intel Macs
if ($darwin && $ffi->sysctlbyname('hw.perflevel0.logicalcpu', FFI::addr($cores), FFI::addr($size), null, 0) === 0) {
return $cores->cdata;
}
if ($darwin) {
} elseif ($darwin) {
// Reset the size in case the pointer got written to (likely shouldn't happen)
$size->cdata = FFI::sizeof($cores);
}

View file

@ -17,12 +17,12 @@ abstract class QueueableListener implements ShouldQueue
{
if (static::$shouldQueue) {
return true;
} else {
// The listener is not queued so we manually
// pass the event to the handle() method.
$this->handle($event);
return false;
}
// The listener is not queued so we manually
// pass the event to the handle() method.
$this->handle($event);
return false;
}
}