Minor optimization in DboSource::__scrubQueryData(), removing unneded isset() check.

This commit is contained in:
ADmad 2010-03-18 03:02:58 +05:30
parent 6a723bb515
commit e2113e4aa2

View file

@ -532,12 +532,12 @@ class DboSource extends DataSource {
return $this->cacheMethod(__FUNCTION__, $cacheKey, $this->startQuote . $data . $this->endQuote);
}
$items = explode('.', $data);
return $this->cacheMethod(__FUNCTION__, $cacheKey,
return $this->cacheMethod(__FUNCTION__, $cacheKey,
$this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote
);
}
if (preg_match('/^[\w-]+\.\*$/', $data)) { // string.*
return $this->cacheMethod(__FUNCTION__, $cacheKey,
return $this->cacheMethod(__FUNCTION__, $cacheKey,
$this->startQuote . str_replace('.*', $this->endQuote . '.*', $data)
);
}
@ -1884,7 +1884,7 @@ class DboSource extends DataSource {
*/
function __scrubQueryData($data) {
foreach (array('conditions', 'fields', 'joins', 'order', 'limit', 'offset', 'group') as $key) {
if (!isset($data[$key]) || empty($data[$key])) {
if (empty($data[$key])) {
$data[$key] = array();
}
}