Skip to content

Commit 469f7a4

Browse files
committed
Converted shiftVertices to lambda expression and corrected lint formatting
1 parent b39a548 commit 469f7a4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

gap/digraph.gi

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ n -> RandomLatticeCons(IsImmutableDigraph, n));
18431843
InstallMethod(RandomLattice, "for a func and a pos int", [IsFunction, IsPosInt],
18441844
RandomLatticeCons);
18451845

1846-
InstallGlobalFunction(CopyEdgeWeightsForSubdigraph,
1846+
InstallGlobalFunction(CopyEdgeWeightsForSubdigraph,
18471847
function(oldDigraph, newDigraph, removedVertices)
18481848
local oldWeights, newWeights, i, j, weight, shiftVertices;
18491849

@@ -1853,13 +1853,11 @@ function(oldDigraph, newDigraph, removedVertices)
18531853

18541854
oldWeights := EdgeWeights(oldDigraph);
18551855
newWeights := [];
1856+
shiftVertices := x -> x + Length(Filtered(removedVertices, v -> v <= x));
1857+
18561858
for i in [1 .. DigraphNrVertices(newDigraph)] do
18571859
newWeights[i] := [];
1858-
18591860
for j in OutNeighbours(newDigraph, i) do
1860-
shiftVertices := function(x)
1861-
return x + Length(Filtered(removedVertices, v -> v <= x));
1862-
end;
18631861
weight := oldWeights[shiftVertices(i)][shiftVertices(j)];
18641862
Add(newWeights[i], weight);
18651863
od;

0 commit comments

Comments
 (0)