From 90940a774eab876c38d5cef981b4be5bae67a462 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 8 Jul 2018 23:20:56 +0200 Subject: modernize only --- migration/migration.cpp | 8 ++++---- migration/migration.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'migration') 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 migration_list; static std::vector 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& 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& migrations(); static void eval_thunks(); -- cgit v1.2.3