From 61ffc53ca0fa29e15c895de155ab9cde4c073bf8 Mon Sep 17 00:00:00 2001 From: alec Date: Wed, 7 Dec 2011 09:29:56 +0000 Subject: - Cleanup + perf. improvement (substr_count() is really fast!) git-svn-id: https://svn.roundcube.net/trunk@5561 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_result_index.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'roundcubemail/program/include/rcube_result_index.php') diff --git a/roundcubemail/program/include/rcube_result_index.php b/roundcubemail/program/include/rcube_result_index.php index 4decaf9e8..e1e6056f5 100644 --- a/roundcubemail/program/include/rcube_result_index.php +++ b/roundcubemail/program/include/rcube_result_index.php @@ -157,9 +157,9 @@ class rcube_result_index $this->meta['count'] = 0; $this->meta['length'] = 0; } - else - // @TODO: check performance substr_count() vs. explode() + else { $this->meta['count'] = 1 + substr_count($this->raw_data, self::SEPARATOR_ELEMENT); + } return $this->meta['count']; } @@ -185,7 +185,6 @@ class rcube_result_index public function max() { if (!isset($this->meta['max'])) { - // @TODO: do it by parsing raw_data? $this->meta['max'] = (int) @max($this->get()); } @@ -201,7 +200,6 @@ class rcube_result_index public function min() { if (!isset($this->meta['min'])) { - // @TODO: do it by parsing raw_data? $this->meta['min'] = (int) @min($this->get()); } -- cgit v1.2.3