< Summary

Class:Itinero.Routing.Costs.ICostFunctionExtensions
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Routing/Costs/ICostFunctionExtensions.cs
Covered lines:15
Uncovered lines:0
Coverable lines:15
Total lines:25
Line coverage:100% (15 of 15)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)
Tag:251_23667616543

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
GetDijkstraWeightFunc(...)100%2100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Routing/Costs/ICostFunctionExtensions.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using Itinero.Network;
 3using Itinero.Routing.Flavours.Dijkstra;
 4
 5namespace Itinero.Routing.Costs;
 6
 7internal static class ICostFunctionExtensions
 8{
 9    public static DijkstraWeightFunc GetDijkstraWeightFunc(this ICostFunction costFunction)
 1129310    {
 1129311        return (enumerator, previousEdges) =>
 94262312        {
 1129313            // fast path: when there are no previous edges, pass null to avoid boxing.
 94262314            if (previousEdges.IsEmpty)
 40157015            {
 40157016                var (_, _, cost, _) = costFunction.Get(enumerator, true, null);
 40157017                return (cost, 0.0);
 1129318            }
 1129319
 1129320            // box the struct for ICostFunction.
 54105321            var (_, _, cost2, turnCost) = costFunction.Get(enumerator, true, previousEdges);
 54105322            return (cost2, turnCost);
 95391623        };
 1129324    }
 25}

Methods/Properties

GetDijkstraWeightFunc(...)