Index: /trunk/roundcubemail/program/include/rcube_result_index.php
===================================================================
--- /trunk/roundcubemail/program/include/rcube_result_index.php	(revision 5560)
+++ /trunk/roundcubemail/program/include/rcube_result_index.php	(revision 5561)
@@ -158,7 +158,7 @@
             $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'];
@@ -186,5 +186,4 @@
     {
         if (!isset($this->meta['max'])) {
-            // @TODO: do it by parsing raw_data?
             $this->meta['max'] = (int) @max($this->get());
         }
@@ -202,5 +201,4 @@
     {
         if (!isset($this->meta['min'])) {
-            // @TODO: do it by parsing raw_data?
             $this->meta['min'] = (int) @min($this->get());
         }
Index: /trunk/roundcubemail/program/include/rcube_result_thread.php
===================================================================
--- /trunk/roundcubemail/program/include/rcube_result_thread.php	(revision 5560)
+++ /trunk/roundcubemail/program/include/rcube_result_thread.php	(revision 5561)
@@ -117,6 +117,7 @@
             $this->meta['count'] = 0;
         }
-        else
+        else {
             $this->meta['count'] = 1 + substr_count($this->raw_data, self::SEPARATOR_ELEMENT);
+        }
 
         if (!$this->meta['count'])
@@ -141,9 +142,7 @@
         }
         else {
-            $regexp = '/((^|' . preg_quote(self::SEPARATOR_ELEMENT, '/')
-                . '|' . preg_quote(self::SEPARATOR_ITEM, '/') . ')[0-9]+)/';
-
-            // @TODO: can we do this in a better way?
-            $this->meta['messages'] = preg_match_all($regexp, $this->raw_data, $m);
+            $this->meta['messages'] = 1
+                + substr_count($this->raw_data, self::SEPARATOR_ELEMENT)
+                + substr_count($this->raw_data, self::SEPARATOR_ITEM);
         }
 
@@ -163,5 +162,4 @@
     {
         if (!isset($this->meta['max'])) {
-            // @TODO: do it by parsing raw_data?
             $this->meta['max'] = (int) @max($this->get());
         }
@@ -178,5 +176,4 @@
     {
         if (!isset($this->meta['min'])) {
-            // @TODO: do it by parsing raw_data?
             $this->meta['min'] = (int) @min($this->get());
         }
