< 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:284_38118444584

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)
 1156410    {
 1156411        return (enumerator, previousEdges) =>
 96422212        {
 1156413            // fast path: when there are no previous edges, pass null to avoid boxing.
 96422214            if (previousEdges.IsEmpty)
 40737215            {
 40737216                var (_, _, localAccess, cost, _) = costFunction.Get(enumerator, true);
 40737217                return (cost, 0.0, localAccess);
 1156418            }
 1156419
 1156420            // box the struct for ICostFunction.
 55685021            var (_, _, localAccess2, cost2, turnCost) = costFunction.Get(enumerator, true, previousEdges);
 55685022            return (cost2, turnCost, localAccess2);
 97578623        };
 1156424    }
 25}

Methods/Properties

GetDijkstraWeightFunc(...)