diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-01-20 13:29:21 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-01-20 17:04:56 +0100 |
| commit | e6ea3bd0d617a91645d96e89459f988bd67b4117 (patch) | |
| tree | fe7fa25de9f95c66b1da8e2730fdfcb253f6cd31 /windows/winutil/src | |
| parent | c0833b0589424bf21e14afec6b57ab742886a763 (diff) | |
| download | mullvadvpn-e6ea3bd0d617a91645d96e89459f988bd67b4117.tar.xz mullvadvpn-e6ea3bd0d617a91645d96e89459f988bd67b4117.zip | |
Refactor ValueMapper
Diffstat (limited to 'windows/winutil/src')
| -rw-r--r-- | windows/winutil/src/winutil/winutil.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/windows/winutil/src/winutil/winutil.cpp b/windows/winutil/src/winutil/winutil.cpp index 4ea0ac27e3..b5b809a216 100644 --- a/windows/winutil/src/winutil/winutil.cpp +++ b/windows/winutil/src/winutil/winutil.cpp @@ -16,16 +16,11 @@ WinUtil_MigrateAfterWindowsUpdate( { try { - using value_type = common::ValueMapper<migration::MigrationStatus, WINUTIL_MIGRATION_STATUS>::value_type; - - const common::ValueMapper<migration::MigrationStatus, WINUTIL_MIGRATION_STATUS> mapper = - { - value_type(migration::MigrationStatus::Success, WINUTIL_MIGRATION_STATUS_SUCCESS), - value_type(migration::MigrationStatus::Aborted, WINUTIL_MIGRATION_STATUS_ABORTED), - value_type(migration::MigrationStatus::NothingToMigrate, WINUTIL_MIGRATION_STATUS_NOTHING_TO_MIGRATE), - }; - - return mapper.map(migration::MigrateAfterWindowsUpdate()); + return common::ValueMapper::Map(migration::MigrateAfterWindowsUpdate(), { + std::make_pair(migration::MigrationStatus::Success, WINUTIL_MIGRATION_STATUS_SUCCESS), + std::make_pair(migration::MigrationStatus::Aborted, WINUTIL_MIGRATION_STATUS_ABORTED), + std::make_pair(migration::MigrationStatus::NothingToMigrate, WINUTIL_MIGRATION_STATUS_NOTHING_TO_MIGRATE), + }); } catch (const std::exception &err) { |
