Skip to content

Commit

Permalink
Minor optimization in DboSource::__scrubQueryData(), removing unneded…
Browse files Browse the repository at this point in the history
… isset() check.
  • Loading branch information
ADmad committed Mar 17, 2010
1 parent 6a723bb commit e2113e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -532,12 +532,12 @@ function name($data) {
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)
);
}
Expand Down Expand Up @@ -1884,7 +1884,7 @@ function resolveKey($model, $key, $assoc = null) {
*/
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();
}
}
Expand Down

0 comments on commit e2113e4

Please sign in to comment.