summaryrefslogtreecommitdiffhomepage
path: root/migration
diff options
context:
space:
mode:
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.cpp8
-rw-r--r--migration/migration.hpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/migration/migration.cpp b/migration/migration.cpp
index 569dff99..8e5fea5e 100644
--- a/migration/migration.cpp
+++ b/migration/migration.cpp
@@ -29,11 +29,11 @@ namespace detail {
static std::vector<mptr> migration_list;
static std::vector<mfun> migration_thunks;
-void migrator::register_migration(mptr m)
+void migrator::register_migration(mptr const& m)
{
const QString date = m->unique_date();
- for (mptr m2 : migration_list)
+ for (mptr const& m2 : migration_list)
if (m2->unique_date() == date)
std::abort();
@@ -77,7 +77,7 @@ void migrator::eval_thunks()
mptr m = fun();
register_migration(m);
}
- if (migration_thunks.size())
+ if (!migration_thunks.empty())
sort_migrations();
migration_thunks.clear();
}
@@ -118,7 +118,7 @@ QString migrator::time_after_migrations()
{
const std::vector<mptr>& list = migrations();
- if (list.size() == 0u)
+ if (list.empty())
return QStringLiteral("19700101_00");
QString ret = list[list.size() - 1]->unique_date();
diff --git a/migration/migration.hpp b/migration/migration.hpp
index 48689fc6..42c8bead 100644
--- a/migration/migration.hpp
+++ b/migration/migration.hpp
@@ -33,7 +33,7 @@ namespace detail {
private:
static void sort_migrations();
- static void register_migration(mptr m);
+ static void register_migration(const mptr& m);
static std::vector<mptr>& migrations();
static void eval_thunks();