mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-16 03:28:56 +08:00
Optimized checks order in conditions
This commit is contained in:
@@ -398,7 +398,7 @@ class MessageController extends Controller
|
||||
}
|
||||
ksort($existingMessages);
|
||||
foreach ($existingMessages as $message => $translation) {
|
||||
if (!isset($merged[$message]) && !isset($todo[$message]) && !$removeUnused) {
|
||||
if (!$removeUnused && !isset($merged[$message]) && !isset($todo[$message])) {
|
||||
if (!empty($translation) && strncmp($translation, '@@', 2) === 0 && substr_compare($translation, '@@', -2, 2) === 0) {
|
||||
$todo[$message] = $translation;
|
||||
} else {
|
||||
@@ -512,7 +512,7 @@ EOD;
|
||||
|
||||
// add obsolete unused messages
|
||||
foreach ($existingMessages as $message => $translation) {
|
||||
if (!isset($merged[$category . chr(4) . $message]) && !isset($todos[$category . chr(4) . $message]) && !$removeUnused) {
|
||||
if (!$removeUnused && !isset($merged[$category . chr(4) . $message]) && !isset($todos[$category . chr(4) . $message])) {
|
||||
if (!empty($translation) && substr($translation, 0, 2) === '@@' && substr($translation, -2) === '@@') {
|
||||
$todos[$category . chr(4) . $message] = $translation;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user