Skip to content

Commit 635b91a

Browse files
committed
Add information about how many files have been found
1 parent f2d437f commit 635b91a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/InMemoryElevationProvider.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.IO;
5+
using System.Linq;
56
using System.Threading.Tasks;
67
using ICSharpCode.SharpZipLib.Core;
78
using Microsoft.AspNetCore.Hosting;
@@ -41,14 +42,11 @@ public async Task Initialize()
4142
}
4243

4344
ElevationHelper.UnzipIfNeeded(_fileProvider, _logger);
44-
var hgtFiles = _fileProvider.GetDirectoryContents(ElevationHelper.ELEVATION_CACHE);
45-
45+
var hgtFiles = _fileProvider.GetDirectoryContents(ElevationHelper.ELEVATION_CACHE)
46+
.Where(f => f.PhysicalPath.EndsWith(".hgt")).ToArray();
47+
_logger.LogInformation($"Found {hgtFiles.Length} hgt files.");
4648
foreach (var hgtFile in hgtFiles)
4749
{
48-
if (!hgtFile.PhysicalPath.EndsWith(".hgt"))
49-
{
50-
continue;
51-
}
5250
var key = ElevationHelper.FileNameToKey(hgtFile.Name);
5351
if (key == null)
5452
{

0 commit comments

Comments
 (0)