Fix/simplify move c'tor/assignment of Database
This commit is contained in:
parent
cca0db2d1f
commit
92f83fadb6
|
@ -55,23 +55,7 @@ Database::Database(std::string &&name, std::string &&path)
|
|||
{
|
||||
}
|
||||
|
||||
Database::Database(Database &&other)
|
||||
: name(std::move(other.name))
|
||||
, path(std::move(other.path))
|
||||
, filesPath(std::move(other.filesPath))
|
||||
, mirrors(std::move(other.mirrors))
|
||||
, usage(other.usage)
|
||||
, signatureLevel(other.signatureLevel)
|
||||
, arch(std::move(other.arch))
|
||||
, dependencies(std::move(other.dependencies))
|
||||
, localPkgDir(std::move(other.localPkgDir))
|
||||
, localDbDir(std::move(other.localDbDir))
|
||||
, lastUpdate(other.lastUpdate)
|
||||
, syncFromMirror(other.syncFromMirror)
|
||||
, toBeDiscarded(other.toBeDiscarded)
|
||||
, m_storage(std::move(other.m_storage))
|
||||
{
|
||||
}
|
||||
Database::Database(Database &&other) = default;
|
||||
|
||||
Database::~Database()
|
||||
{
|
||||
|
|
|
@ -119,7 +119,7 @@ struct LIBPKG_EXPORT Database : public ReflectiveRapidJSON::JsonSerializable<Dat
|
|||
explicit Database(std::string &&name, std::string &&path);
|
||||
Database(Database &&other);
|
||||
~Database();
|
||||
Database &operator=(Database &&rhs);
|
||||
Database &operator=(Database &&rhs) = default;
|
||||
|
||||
void initStorage(StorageDistribution &storage);
|
||||
void deducePathsFromLocalDirs();
|
||||
|
@ -171,14 +171,6 @@ private:
|
|||
std::unique_ptr<DatabaseStorage> m_storage;
|
||||
};
|
||||
|
||||
inline Database &Database::operator=(Database &&rhs)
|
||||
{
|
||||
if (this != &rhs) {
|
||||
*this = std::move(rhs);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline PackageSearchResult::PackageSearchResult()
|
||||
: db(nullptr)
|
||||
, id(0)
|
||||
|
|
Loading…
Reference in New Issue