The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 7d1f941a authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Optimize saving a search a tiny bit.

parent 7e5d2996
No related merge requests found
...@@ -151,6 +151,7 @@ class Search extends Gateway ...@@ -151,6 +151,7 @@ class Search extends Gateway
$newSearch, $sessionId, $searchHistory = [] $newSearch, $sessionId, $searchHistory = []
) { ) {
// Duplicate elimination // Duplicate elimination
$newUrl = $newSearch->getUrlQuery()->getParams();
foreach ($searchHistory as $oldSearch) { foreach ($searchHistory as $oldSearch) {
// Deminify the old search (note that if we have a resource, we need // Deminify the old search (note that if we have a resource, we need
// to grab the contents -- this is necessary for PostgreSQL compatibility // to grab the contents -- this is necessary for PostgreSQL compatibility
...@@ -159,7 +160,6 @@ class Search extends Gateway ...@@ -159,7 +160,6 @@ class Search extends Gateway
$dupSearch = $minSO->deminify($manager); $dupSearch = $minSO->deminify($manager);
// See if the classes and urls match // See if the classes and urls match
$oldUrl = $dupSearch->getUrlQuery()->getParams(); $oldUrl = $dupSearch->getUrlQuery()->getParams();
$newUrl = $newSearch->getUrlQuery()->getParams();
if (get_class($dupSearch) == get_class($newSearch) if (get_class($dupSearch) == get_class($newSearch)
&& $oldUrl == $newUrl && $oldUrl == $newUrl
) { ) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment