diff --git a/src/libs/services/recommendation/impl/features/FeaturesEngine.cpp b/src/libs/services/recommendation/impl/features/FeaturesEngine.cpp index daee3d4b..fddb0324 100644 --- a/src/libs/services/recommendation/impl/features/FeaturesEngine.cpp +++ b/src/libs/services/recommendation/impl/features/FeaturesEngine.cpp @@ -213,7 +213,7 @@ FeaturesEngine::loadFromTraining(const TrainSettings& trainSettings, const Progr } void -FeaturesEngine::loadFromCache(FeaturesEngineCache cache) +FeaturesEngine::loadFromCache(FeaturesEngineCache&& cache) { LMS_LOG(RECOMMENDATION, INFO) << "Constructing features classifier from cache..."; @@ -341,9 +341,9 @@ FeaturesEngine::load(bool forceReload, const ProgressCallback& progressCallback) { FeaturesEngineCache::invalidate(); } - else if (const std::optional cache {FeaturesEngineCache::read()}) + else if (std::optional cache {FeaturesEngineCache::read()}) { - loadFromCache(*cache); + loadFromCache(std::move(*cache)); return; } diff --git a/src/libs/services/recommendation/impl/features/FeaturesEngine.hpp b/src/libs/services/recommendation/impl/features/FeaturesEngine.hpp index 706d7f72..d6839f16 100644 --- a/src/libs/services/recommendation/impl/features/FeaturesEngine.hpp +++ b/src/libs/services/recommendation/impl/features/FeaturesEngine.hpp @@ -63,7 +63,7 @@ class FeaturesEngine : public IEngine ReleaseContainer getSimilarReleases(Database::ReleaseId releaseId, std::size_t maxCount) const override; ArtistContainer getSimilarArtists(Database::ArtistId artistId, EnumSet linkTypes, std::size_t maxCount) const override; - void loadFromCache(FeaturesEngineCache cache); + void loadFromCache(FeaturesEngineCache&& cache); // Use training (may be very slow) struct TrainSettings