Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/111363

Change subject: Split up ShallowCompactor's expand; move building of queries 
into own method
......................................................................

Split up ShallowCompactor's expand; move building of queries into own method

Change-Id: I694f7f5443e36482b3e39f3b3660a60173bbb387
---
M includes/Data/ObjectManager.php
1 file changed, 25 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/63/111363/1

diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php
index 718ecbe..3c1b70d 100644
--- a/includes/Data/ObjectManager.php
+++ b/includes/Data/ObjectManager.php
@@ -1506,7 +1506,19 @@
                return array_map( array( $this, 'compactRow' ), $rows );
        }
 
-       public function expandCacheResult( array $cached, array $keyToQuery ) {
+       /**
+        * @return UniqueFeatureIndex
+        */
+       public function getShallow() {
+               return $this->shallow;
+       }
+
+       /**
+        * @param array $cached
+        * @param array $keyToQuery
+        * @return array
+        */
+       public function getUniqueQueries( array $cached, array $keyToQuery ) {
                $results = $this->inner->expandCacheResult( $cached, 
$keyToQuery );
                // Allows us to flatten $results into a single $query array, 
then
                // rebuild final return value in same structure and order as 
$results.
@@ -1517,7 +1529,18 @@
                        }
                }
 
-               $innerResult = $this->shallow->findMulti( 
$duplicator->getUniqueQueries() );
+               return $duplicator->getUniqueQueries();
+       }
+
+       /**
+        * @param array $cached
+        * @param array $keyToQuery
+        * @return array
+        */
+       public function expandCacheResult( array $cached, array $keyToQuery ) {
+               $duplicator = new ResultDuplicator( 
$this->shallow->getPrimaryKeyColumns(), 2 );
+               $queries = $this->getUniqueQueries( $cached, $keyToQuery );
+               $innerResult = $this->shallow->findMulti( $queries );
                foreach ( $innerResult as $rows ) {
                        // __construct guaranteed the shallow backing index is 
a unique, so $first is only result
                        $first = reset( $rows );

-- 
To view, visit https://gerrit.wikimedia.org/r/111363
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I694f7f5443e36482b3e39f3b3660a60173bbb387
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to