From 34d67990c2987d662919f06bdf18d5cc522c2560 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 14:37:36 +0300 Subject: Optimize custom_result_object() --- system/database/DB_result.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'system') 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]; } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b