Permalink
Browse files

Change while with foreach for performance.

  • Loading branch information...
1 parent 0edfe24 commit 351993ce9f51b258a9c87c096f063276be4fc9cb @acidvertigo acidvertigo committed May 25, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 catalog/includes/classes/language.php
@@ -83,7 +83,7 @@ function get_browser_language() {
for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
reset($this->languages);
- while (list($key, $value) = each($this->languages)) {
+ foreach($this->languages as $key => $value) {
if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
$this->language = $this->catalog_languages[$key];
break 2;

0 comments on commit 351993c

Please sign in to comment.