Browse Source

remove unneeded non null assertion

Abhinav 1 year ago
parent
commit
142f485a4a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      apps/photos/src/services/locationSearchService.ts

+ 3 - 3
apps/photos/src/services/locationSearchService.ts

@@ -65,10 +65,10 @@ function isLocationCloseToPoint(
     location: Location,
     location: Location,
     radius: number
     radius: number
 ) {
 ) {
-    const a = (radius * _scaleFactor(centerPoint.latitude!)) / KMS_PER_DEGREE;
+    const a = (radius * _scaleFactor(centerPoint.latitude)) / KMS_PER_DEGREE;
     const b = radius / KMS_PER_DEGREE;
     const b = radius / KMS_PER_DEGREE;
-    const x = centerPoint.latitude! - location.latitude!;
-    const y = centerPoint.longitude! - location.longitude!;
+    const x = centerPoint.latitude - location.latitude;
+    const y = centerPoint.longitude - location.longitude;
     if ((x * x) / (a * a) + (y * y) / (b * b) <= 1) {
     if ((x * x) / (a * a) + (y * y) / (b * b) <= 1) {
         return true;
         return true;
     }
     }