Skip to content

Commit 4a76f1d

Browse files
committed
combined 2 guard clauses
Two guard clauses have been combined into one. Previously one clause was checking for the object's existence, the other was checking for its attributes. Now the same guard clause chains the conditions together thereby reducing a code line.
1 parent 1cff9cd commit 4a76f1d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/coffee/utils/array-sync.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ angular.module('uiGmapgoogle-maps').factory 'uiGmaparray-sync', [
4646
set_at: (index) ->
4747
return if isSetFromScope #important to avoid cyclic forever change loop watch to map event change and back
4848
value = mapArray.getAt(index)
49-
return unless value
50-
return if not value.lng or not value.lat
49+
return unless value and value.lng and value.lat
5150
geojsonArray[index][1] = value.lat()
5251
geojsonArray[index][0] = value.lng()
5352

0 commit comments

Comments
 (0)