Some small improvements to CI_DB_interbase_result
diff --git a/system/database/drivers/interbase/interbase_result.php b/system/database/drivers/interbase/interbase_result.php
index 5bf0c90..fd4178d 100644
--- a/system/database/drivers/interbase/interbase_result.php
+++ b/system/database/drivers/interbase/interbase_result.php
@@ -25,8 +25,6 @@
  * @filesource
  */
 
-// ------------------------------------------------------------------------
-
 /**
  * Interbase/Firebird Result Class
  *
@@ -43,18 +41,18 @@
 	/**
 	 * Number of rows in the result set
 	 *
-	 * @return	integer
+	 * @return	int
 	 */
 	public function num_rows()
 	{
-		if( ! is_null($this->num_rows))
+		if (is_int($this->num_rows))
 		{
 			return $this->num_rows;
 		}
-		
-		//Get the results so that you can get an accurate rowcount
+
+		// Get the results so that you can get an accurate rowcount
 		$this->result();
-		
+
 		return $this->num_rows;
 	}
 
@@ -63,7 +61,7 @@
 	/**
 	 * Number of fields in the result set
 	 *
-	 * @return	integer
+	 * @return	int
 	 */
 	public function num_fields()
 	{
@@ -102,20 +100,17 @@
 	 */
 	public function field_data()
 	{
-		
 		$retval = array();
-		for ($i = 0, $num_fields = $this->num_fields(); $i < $num_fields; $i++)
+		for ($i = 0, $c = $this->num_fields(); $i < $c; $i++)
 		{
 			$info = ibase_field_info($this->result_id, $i);
-		
-			$F				= new stdClass();
-			$F->name		= $info['name'];
-			$F->type		= $info['type'];
-			$F->max_length	= $info['length'];
-			$F->primary_key = 0;
-			$F->default		= '';
 
-			$retval[] = $F;
+			$retval[$i]			= new stdClass();
+			$retval[$i]->name		= $info['name'];
+			$retval[$i]->type		= $info['type'];
+			$retval[$i]->max_length		= $info['length'];
+			$retval[$i]->primary_key	= 0;
+			$retval[$i]->default		= '';
 		}
 
 		return $retval;
@@ -126,7 +121,7 @@
 	/**
 	 * Free the result
 	 *
-	 * @return	null
+	 * @return	void
 	 */
 	public function free_result()
 	{
@@ -138,7 +133,7 @@
 	/**
 	 * Data Seek
 	 *
-	 * Moves the internal pointer to the desired offset.  We call
+	 * Moves the internal pointer to the desired offset. We call
 	 * this internally before fetching results to make sure the
 	 * result set starts at zero
 	 *
@@ -146,11 +141,8 @@
 	 */
 	protected function _data_seek($n = 0)
 	{
-		//Set the row count to 0
-		$this->num_rows = 0;
-	
-		//Interbase driver doesn't implement a suitable function
-		return FALSE;	
+		// Interbase driver doesn't implement a suitable function
+		return FALSE;
 	}
 
 	// --------------------------------------------------------------------
@@ -169,7 +161,7 @@
 			//Increment row count
 			$this->num_rows++;
 		}
-	
+
 		return $row;
 	}
 
@@ -189,10 +181,10 @@
 			//Increment row count
 			$this->num_rows++;
 		}
-		
+
 		return $row;
 	}
-	
+
 	// --------------------------------------------------------------------
 
 	/**
@@ -202,29 +194,20 @@
 	 */
 	public function result_object()
 	{
-		if (count($this->result_object) > 0)
+		if (count($this->result_object) === $this->num_rows)
 		{
 			return $this->result_object;
 		}
-		
-		// Convert result array to object so that 
+
+		// Convert result array to object so that
 		// We don't have to get the result again
-		if (count($this->result_array) > 0)
+		if (($c = count($this->result_array)) > 0)
 		{
-			$i = 0;
-		
-			foreach ($this->result_array as $array)
+			for ($i = 0; $i < $c; $i++)
 			{
-				$this->result_object[$i] = new StdClass();
-			
-				foreach ($array as $key => $val)
-				{
-					$this->result_object[$i]->{$key} = $val;
-				}
-				
-				++$i;
+				$this->result_object[$i] = (object) $this->result_array[$i];
 			}
-			
+
 			return $this->result_object;
 		}
 
@@ -254,20 +237,20 @@
 	 */
 	public function result_array()
 	{
-		if (count($this->result_array) > 0)
+		if (count($this->result_array) === $this->num_rows)
 		{
 			return $this->result_array;
 		}
-		
+
 		// Since the object and array are really similar, just case
 		// the result object to an array  if need be
-		if (count($this->result_object) > 0)
+		if (($c = count($this->result_object)) > 0)
 		{
-			foreach ($this->result_object as $obj)
+			for ($i = 0; $i < $c; $i++)
 			{
-				$this->result_array[] = (array) $obj;
+				$this->result_array[$i] = (array) $this->result_object[$i];
 			}
-		
+
 			return $this->result_array;
 		}