mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-01 10:48:53 +00:00
Small opcode optimizations
This commit is contained in:
@@ -207,17 +207,14 @@ class UpdatePerformanceHelper
|
||||
return -1;
|
||||
}
|
||||
|
||||
$last = strtolower($limit[strlen($limit) - 1]);
|
||||
$value = (int) $limit;
|
||||
$last = strtolower($limit[-1]);
|
||||
|
||||
switch ($last) {
|
||||
case 'g':
|
||||
$value *= 1024;
|
||||
case 'm':
|
||||
$value *= 1024;
|
||||
case 'k':
|
||||
$value *= 1024;
|
||||
}
|
||||
$value = match ($last) {
|
||||
'g' => (int) $limit * 1024 * 1024 * 1024,
|
||||
'm' => (int) $limit * 1024 * 1024,
|
||||
'k' => (int) $limit * 1024,
|
||||
default => (int) $limit,
|
||||
};
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user