From 3b1d410b4ede2fd54be23bb47da5950535df9b04 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 24 Jan 2014 13:05:18 -0500
Subject: [PATCH] Fix confusing intersect/filter methods naming/behaviour.

---
 program/lib/Roundcube/rcube_result_index.php |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/program/lib/Roundcube/rcube_result_index.php b/program/lib/Roundcube/rcube_result_index.php
index 5f592c5..058f25c 100644
--- a/program/lib/Roundcube/rcube_result_index.php
+++ b/program/lib/Roundcube/rcube_result_index.php
@@ -231,27 +231,11 @@
 
 
     /**
-     * Filters data set. Removes elements listed in $ids list.
+     * Filters data set. Removes elements not listed in $ids list.
      *
      * @param array $ids List of IDs to remove.
      */
     public function filter($ids = array())
-    {
-        $data = $this->get();
-        $data = array_diff($data, $ids);
-
-        $this->meta          = array();
-        $this->meta['count'] = count($data);
-        $this->raw_data      = implode(self::SEPARATOR_ELEMENT, $data);
-    }
-
-
-    /**
-     * Filters data set. Removes elements not listed in $ids list.
-     *
-     * @param array $ids List of IDs to keep.
-     */
-    public function intersect($ids = array())
     {
         $data = $this->get();
         $data = array_intersect($data, $ids);
@@ -332,6 +316,7 @@
         if (empty($this->raw_data)) {
             return array();
         }
+
         return explode(self::SEPARATOR_ELEMENT, $this->raw_data);
     }
 

--
Gitblit v1.9.1