From c5a7db6c85cabd2ccf4836d0865efe32135e94b2 Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Fri, 17 Mar 2023 20:47:42 +0200 Subject: [PATCH] remove a redundant null-check customProps is not nullable. --- src/frontend/generate.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/frontend/generate.ts b/src/frontend/generate.ts index 72bcb2d..174917f 100644 --- a/src/frontend/generate.ts +++ b/src/frontend/generate.ts @@ -162,11 +162,8 @@ export async function extractProps(config: DeviceConfig, customState: SystemStat let fingerprint = stockProps.get('system')!.get('ro.system.build.fingerprint')! // Diff - let missingProps: PartitionProps | undefined - if (customProps != null) { - let propChanges = diffPartitionProps(stockProps, customProps) - missingProps = new Map(Array.from(propChanges.entries()).map(([part, props]) => [part, props.removed])) - } + let propChanges = diffPartitionProps(stockProps, customProps) + let missingProps: PartitionProps = new Map(Array.from(propChanges.entries()).map(([part, props]) => [part, props.removed])) // A/B OTA partitions let stockOtaParts = stockProps.get('product')!.get('ro.product.ab_ota_partitions')!.split(',')