Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Use isset() instead of array_key_exists()
Browse files Browse the repository at this point in the history
  • Loading branch information
vlakoff committed Jan 23, 2016
1 parent f57ba4d commit 8494788
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Faker/UniqueGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function __get($attribute)
*/
public function __call($name, $arguments)
{
if (!isset($this->uniques[$name])) {
$this->uniques[$name] = array();
}
$i = 0;
do {
$i++;
Expand All @@ -48,9 +45,9 @@ public function __call($name, $arguments)
}
$res = call_user_func_array(array($this->generator, $name), $arguments);
$serialized = serialize($res);
} while (array_key_exists($serialized, $this->uniques[$name]));
} while (isset($this->uniques[$name][$serialized]));

$this->uniques[$name][$serialized]= null;
$this->uniques[$name][$serialized] = true;

return $res;
}
Expand Down

0 comments on commit 8494788

Please sign in to comment.