Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/24/22 21:45:48 (2 years ago)
Author:
gkronber
Message:

#3134: bugfixes and improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs

    r18051 r18208  
    453453    }
    454454
    455     private Task<DoubleLimit> UpdateAllSeriesDataAsync(CancellationToken cancellationToken) {
    456       var updateTasks = solutions.Select(solution => UpdateSeriesDataAsync(solution, cancellationToken));
    457 
    458       return Task.Run(() => {
    459         double min = double.MaxValue, max = double.MinValue;
    460         foreach (var update in updateTasks) {
    461           var limit = update.Result;
    462           if (limit.Lower < min) min = limit.Lower;
    463           if (limit.Upper > max) max = limit.Upper;
    464         }
    465 
    466         return new DoubleLimit(min, max);
    467       }, cancellationToken);
     455    private async Task<DoubleLimit> UpdateAllSeriesDataAsync(CancellationToken cancellationToken) {
     456      var updateTasks = solutions.Select(solution => UpdateSeriesDataAsync(solution, cancellationToken)).ToArray();
     457
     458      double min = double.MaxValue, max = double.MinValue;
     459      foreach (var update in updateTasks) {
     460        var limit = await update;
     461        if (limit.Lower < min) min = limit.Lower;
     462        if (limit.Upper > max) max = limit.Upper;
     463      }
     464
     465      return new DoubleLimit(min, max);
    468466    }
    469467
Note: See TracChangeset for help on using the changeset viewer.