!488 refactor: 优化逻辑短路,例如空字符串,做了 2 次逻辑判断

Merge pull request !488 from shali/develop
develop
Karson 2025-06-26 09:09:02 +00:00 committed by Gitee
commit 2e48ea5ddf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ if (!function_exists('__')) {
*/ */
function __($name, $vars = [], $lang = '') function __($name, $vars = [], $lang = '')
{ {
if (is_numeric($name) || !$name) { if (!$name || is_numeric($name)) {
return $name; return $name;
} }
if (!is_array($vars)) { if (!is_array($vars)) {