From 5420bf307b08ec4653f7112c9bf83e877d71d99d Mon Sep 17 00:00:00 2001 From: David Causse Date: Mon, 22 Jul 2019 12:08:32 +0200 Subject: [PATCH] Deprecate SearchResultSet::free Was only called by SpecialSearch, according to IResultWrapper::free() this method is rarely worth being called. Therefor it does not seem wise to expose it in the upcoming interface defining a search result set. Bug: T228626 Change-Id: I12d41a488025eb2d6dd543c9fbdc1c803c840316 --- RELEASE-NOTES-1.34 | 1 + includes/search/SearchResultSet.php | 2 +- includes/search/SqlSearchResultSet.php | 8 -------- includes/specials/SpecialSearch.php | 8 -------- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index 57d635e5ef..32a858b432 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -378,6 +378,7 @@ because of Phabricator reports. and should no longer be passed. Search engine implemenations should be responsible for carrying relevant information needed for highlighting with their own SearchResultSet/SearchResult sub-classes. +* SearchResultSet::free() method is deprecated. * SearchEngine::$searchTerms protected field is deprecated. Moved to SearchDatabase. * The use of the $terms param in the ShowSearchHit and ShowSearchHitTitle diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 5ee96cba65..38f83a9e78 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -234,9 +234,9 @@ class SearchResultSet implements Countable, IteratorAggregate { /** * Frees the result set, if applicable. + * @deprecated noop since 1.34 */ function free() { - // ... } /** diff --git a/includes/search/SqlSearchResultSet.php b/includes/search/SqlSearchResultSet.php index 87068ca3d3..f5d795f4b6 100644 --- a/includes/search/SqlSearchResultSet.php +++ b/includes/search/SqlSearchResultSet.php @@ -66,14 +66,6 @@ class SqlSearchResultSet extends SearchResultSet { return $this->results; } - function free() { - if ( $this->resultSet === false ) { - return; - } - - $this->resultSet->free(); - } - function getTotalHits() { if ( !is_null( $this->totalHits ) ) { return $this->totalHits; diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index e1fbe6a488..c746e78387 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -443,14 +443,6 @@ class SpecialSearch extends SpecialPage { $term, $this->offset, $titleMatches, $textMatches ) ); - if ( $titleMatches ) { - $titleMatches->free(); - } - - if ( $textMatches ) { - $textMatches->free(); - } - $out->addHTML( '
' ); // prev/next links -- 2.20.1