Changeset 549 for trunk/Database.pas


Ignore:
Timestamp:
Apr 21, 2024, 8:55:53 PM (7 months ago)
Author:
chronos
Message:
  • Modified: Optimize code with earlier break from for cycle evaluating boolean result.
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Database.pas

    r548 r549  
    10361036        begin
    10371037          Loc1 := dLoc(Loc, Dir and 1 * 2 - 1, Dir shr 1 * 2 - 1);
    1038           if (Loc1 >= 0) and (RealMap[Loc1] and fTerrain < fGrass) then
     1038          if (Loc1 >= 0) and (RealMap[Loc1] and fTerrain < fGrass) then begin
    10391039            OneTileLake := False;
     1040            Break;
     1041          end;
    10401042        end;
    10411043        if not OneTileLake then
     
    14161418    Ok := True;
    14171419    for C := 1 to nsc do
    1418       if nCityLoc[C] < sccount[C] * (8 - MinGood) div (7 - MinGood) then
     1420      if nCityLoc[C] < sccount[C] * (8 - MinGood) div (7 - MinGood) then begin
    14191421        Ok := False;
     1422        Break;
     1423      end;
    14201424  until Ok;
    14211425
Note: See TracChangeset for help on using the changeset viewer.