summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-05 13:37:36 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-05 13:37:36 +0200
commit34d67990c2987d662919f06bdf18d5cc522c2560 (patch)
tree517b588e1302b10649c49441f748aa755c93db14 /system/database
parent166c20b8ddbad36ff11028cff814bef98ba13ae2 (diff)
Optimize custom_result_object()
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_result.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 53a23a8be..fb3cff340 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -313,18 +313,19 @@ class CI_DB_result {
*/
public function custom_row_object($n, $type)
{
- $result = $this->custom_result_object($type);
- if (count($result) === 0)
+ isset($this->custom_result_object[$type]) OR $this->custom_result_object($type);
+
+ if (count($this->custom_result_object[$type]) === 0)
{
return NULL;
}
- if ($n !== $this->current_row && isset($result[$n]))
+ if ($n !== $this->current_row && isset($this->custom_result_object[$type][$n]))
{
$this->current_row = $n;
}
- return $result[$this->current_row];
+ return $this->custom_result_object[$type][$this->current_row];
}
// --------------------------------------------------------------------