< 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:263_26948838820

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)
 1154710    {
 1154711        return (enumerator, previousEdges) =>
 95171612        {
 1154713            // fast path: when there are no previous edges, pass null to avoid boxing.
 95171614            if (previousEdges.IsEmpty)
 40733815            {
 40733816                var (_, _, localAccess, cost, _) = costFunction.Get(enumerator, true, null);
 40733817                return (cost, 0.0, localAccess);
 1154718            }
 1154719
 1154720            // box the struct for ICostFunction.
 54437821            var (_, _, localAccess2, cost2, turnCost) = costFunction.Get(enumerator, true, previousEdges);
 54437822            return (cost2, turnCost, localAccess2);
 96326323        };
 1154724    }
 25}

Methods/Properties

GetDijkstraWeightFunc(...)