mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[mob] Performance improvement
This commit is contained in:
parent
09b88e5bab
commit
a0bb50fc37
@ -145,14 +145,15 @@ class FaceResult {
|
||||
}
|
||||
}
|
||||
|
||||
T getFileIdFromFaceId<T>(String faceId) {
|
||||
T getFileIdFromFaceId<T extends Object>(String faceId) {
|
||||
final String faceIdSplit = faceId.substring(0, faceId.indexOf('_'));
|
||||
if (T == int) {
|
||||
return int.parse(faceId.split("_").first) as T;
|
||||
} else if (T == String) {
|
||||
return faceId.split("_").first as T;
|
||||
} else {
|
||||
throw ArgumentError("Unsupported type");
|
||||
return int.parse(faceIdSplit) as T;
|
||||
}
|
||||
if (T == String) {
|
||||
return faceIdSplit as T;
|
||||
}
|
||||
throw ArgumentError("Unsupported type: $T");
|
||||
}
|
||||
|
||||
int? tryGetFileIdFromFaceId(String faceId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user