π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Avoid repeated copies when batching face feedback
laurenspriemc86c199524e6
diff --git a/mobile/apps/photos/lib/db/ml/dart_db.dart b/mobile/apps/photos/lib/db/ml/dart_db.dartindex 924cf81765..ee8307ca2b 100644--- a/mobile/apps/photos/lib/db/ml/dart_db.dart+++ b/mobile/apps/photos/lib/db/ml/dart_db.dart@@ -171,11 +171,12 @@ class DartMLDataDB) async {final db = await asyncDB;const batchSize = 500;- final numBatches = (faceIDToClusterID.length / batchSize).ceil();+ final entries = faceIDToClusterID.entries.toList(growable: false);+ final numBatches = (entries.length / batchSize).ceil();for (int i = 0; i < numBatches; i++) {final start = i * batchSize;- final end = min((i + 1) * batchSize, faceIDToClusterID.length);- final batch = faceIDToClusterID.entries.toList().sublist(start, end);+ final end = min((i + 1) * batchSize, entries.length);+ final batch = entries.sublist(start, end);const String sql ='''