mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
LvlGraph: Ensure work was done, or quit. No endless loop.
This commit is contained in:
parent
abb908d498
commit
42d6e0bc85
@ -1877,13 +1877,16 @@ end;
|
||||
|
||||
procedure TMinXGraph.SwitchAndShuffle(MaxSingleRun, MaxTotalRun: int64);
|
||||
var
|
||||
Run: int64;
|
||||
Run, LastRun: int64;
|
||||
begin
|
||||
Run:=1;
|
||||
LastRun := 0;
|
||||
while BestCrossCount<>0 do begin
|
||||
SwitchCrossingPairs(MaxSingleRun,Run,Graph.NodeCount div 2);
|
||||
if Run = LastRun then exit;
|
||||
if Run>MaxTotalRun then break;
|
||||
Shuffle;
|
||||
LastRun := Run;
|
||||
end;
|
||||
SwitchCrossingPairs(MaxSingleRun,Run, MaxTotalRun);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user