stabilize NSProgress when lightweight migration falls back to InferredMappingModel

This commit is contained in:
John Estropia
2018-08-09 18:18:21 +09:00
parent 30685d4355
commit 808e8ff97a
2 changed files with 6 additions and 3 deletions

View File

@@ -42,7 +42,10 @@ internal final class MigrationManager: NSMigrationManager, ProgressReporting {
return
}
let progress = self.progress
progress.completedUnitCount = Int64(Float(progress.totalUnitCount) * self.migrationProgress)
progress.completedUnitCount = max(
progress.completedUnitCount,
Int64(Float(progress.totalUnitCount) * self.migrationProgress)
)
}