Permalink
Browse files

Changing empty() to !isset() to avoid additional cache hits when po f…

…iles are missing or empty.
  • Loading branch information...
1 parent 4c33375 commit 5349257bbd90450ed0cfd60873d10274749e64b1 @markstory markstory committed Nov 16, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/libs/i18n.php
View
@@ -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_');
}

0 comments on commit 5349257

Please sign in to comment.