Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Simplify

laurenspriem14451d522ed9
diff --git a/mobile/lib/services/machine_learning/ml_computer.dart b/mobile/lib/services/machine_learning/ml_computer.dart
index 4b92e41628..545ad70a37 100644
--- a/mobile/lib/services/machine_learning/ml_computer.dart
+++ b/mobile/lib/services/machine_learning/ml_computer.dart
@@ -38,7 +38,7 @@ class MLComputerIsolate {
MLComputerIsolate._privateConstructor();
factory MLComputerIsolate() => instance;
- Future<void> init() async {
+ Future<void> _init() async {
return _initLock.synchronized(() async {
if (isSpawned) return;
@@ -58,12 +58,6 @@ class MLComputerIsolate {
});
}
- Future<void> ensureSpawned() async {
- if (!isSpawned) {
- await init();
- }
- }
-
@pragma('vm:entry-point')
static void _isolateMain(SendPort mainSendPort) async {
final receivePort = ReceivePort();
@@ -120,7 +114,7 @@ class MLComputerIsolate {
Future<dynamic> _runInIsolate(
(MLComputerOperation, Map<String, dynamic>) message,
) async {
- await ensureSpawned();
+ await _init();
return _functionLock.synchronized(() async {
final completer = Completer<dynamic>();
final answerPort = ReceivePort();