From 5349257bbd90450ed0cfd60873d10274749e64b1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 16 Nov 2010 07:32:14 -0500 Subject: [PATCH] Changing empty() to !isset() to avoid additional cache hits when po files are missing or empty. --- cake/libs/i18n.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 74ab9406b4e..f1234d46a9c 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -148,11 +148,11 @@ function translate($singular, $plural = null, $domain = null, $category = 6, $co $_this->domain = $domain . '_' . $_this->l10n->lang; - if (empty($_this->__domains[$domain][$_this->__lang])) { + if (!isset($_this->__domains[$domain][$_this->__lang])) { $_this->__domains[$domain][$_this->__lang] = Cache::read($_this->domain, '_cake_core_'); } - if (empty($_this->__domains[$domain][$_this->__lang][$_this->category])) { + if (!isset($_this->__domains[$domain][$_this->__lang][$_this->category])) { $_this->__bindTextDomain($domain); Cache::write($_this->domain, $_this->__domains[$domain][$_this->__lang], '_cake_core_'); }