General cleanup and removal of all unnecessary references

This commit is contained in:
Alexander Liljengård
2016-05-24 16:31:21 +02:00
parent 519ad85fad
commit a65f2aa9f3
43 changed files with 366 additions and 386 deletions

View File

@ -8,30 +8,30 @@ class HashMap
private $_hashToValue = array();
private $_hashToKey = array();
public function &getValue(&$key)
public function getValue($key)
{
$hash = self::getHash($key);
$hashValue = &$this->_hashToValue[$hash];
$hashValue = $this->_hashToValue[$hash];
return $hashValue;
}
public function setValue(&$key, &$value)
public function setValue($key, $value)
{
$hash = self::getHash($key);
$this->_hashToKey[$hash] = &$key;
$this->_hashToValue[$hash] = &$value;
$this->_hashToKey[$hash] = $key;
$this->_hashToValue[$hash] = $value;
return $this;
}
public function &getAllKeys()
public function getAllKeys()
{
$keys = &array_values($this->_hashToKey);
$keys = array_values($this->_hashToKey);
return $keys;
}
public function getAllValues()
{
$values = &array_values($this->_hashToValue);
$values = array_values($this->_hashToValue);
return $values;
}
@ -40,7 +40,7 @@ class HashMap
return count($this->_hashToKey);
}
private static function getHash(&$key)
private static function getHash($key)
{
if (is_object($key)) {
return spl_object_hash($key);