From d01c06eded2d2ff4c6c786469395906f92694703 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 10 Apr 2016 04:47:35 -0400
Subject: [PATCH] CS fixes

---
 CHANGELOG                                     |    1 +
 program/lib/Roundcube/rcube_result_thread.php |    5 +++--
 program/lib/Roundcube/rcube_result_index.php  |    1 -
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index eb47bc8..0972248 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -33,6 +33,7 @@
 - newmail_notifier: Refactor desktop notifications
 - Fix so contactlist_fields option can be set via config file
 - Fix so SPECIAL-USE assignments are forced only until user sets special folders (#4782)
+- Fix performance in reverting order of THREAD result
 
 RELEASE 1.2-beta
 ----------------
diff --git a/program/lib/Roundcube/rcube_result_index.php b/program/lib/Roundcube/rcube_result_index.php
index 2f73c5e..6320bac 100644
--- a/program/lib/Roundcube/rcube_result_index.php
+++ b/program/lib/Roundcube/rcube_result_index.php
@@ -249,7 +249,6 @@
             return;
         }
 
-        // @TODO: maybe do this in chunks
         $data = $this->get();
         $data = array_reverse($data);
         $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
diff --git a/program/lib/Roundcube/rcube_result_thread.php b/program/lib/Roundcube/rcube_result_thread.php
index b80e38b..394fdeb 100644
--- a/program/lib/Roundcube/rcube_result_thread.php
+++ b/program/lib/Roundcube/rcube_result_thread.php
@@ -242,8 +242,9 @@
             return;
         }
 
-        $raw_data_reverse = implode(self::SEPARATOR_ELEMENT, array_reverse(explode(self::SEPARATOR_ELEMENT, $this->raw_data)));
-        $this->raw_data = $raw_data_reverse;
+        $data = explode(self::SEPARATOR_ELEMENT, $this->raw_data);
+        $data = array_reverse($data);
+        $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
 
         $this->meta['pos'] = array();
     }

--
Gitblit v1.9.1