Skip to content

Commit 64450ba

Browse files
committed
Polish Azure parser filtering
Root cause: the last Azure Maps parser cleanup still left one code-quality complaint on the reverse-address mapping loop. Use a Select-based reverse-address pipeline so the parser stays explicit about filtering and mapping without changing behavior.
1 parent 906687c commit 64450ba

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Geocoding.Microsoft/AzureMapsGeocoder.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,12 @@ private IEnumerable<AzureMapsAddress> ParseResponse(AzureSearchResponse response
257257
if (response.Addresses is null)
258258
yield break;
259259

260-
foreach (var reverseResult in response.Addresses.Where(result => result?.Address is not null && !String.IsNullOrWhiteSpace(result.Position)))
260+
foreach (var reverseAddress in response.Addresses
261+
.Where(result => result?.Address is not null && !String.IsNullOrWhiteSpace(result.Position))
262+
.Select(CreateReverseAddress)
263+
.Where(address => address is not null))
261264
{
262-
var reverseAddress = CreateReverseAddress(reverseResult);
263-
if (reverseAddress is not null)
264-
yield return reverseAddress;
265+
yield return reverseAddress!;
265266
}
266267
}
267268

0 commit comments

Comments
 (0)