Ignore:
Timestamp:
Apr 21, 2024, 8:55:53 PM (2 weeks 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/LocalPlayer/ClientTools.pas

    r531 r549  
    178178  Result := False;
    179179  for p1 := 1 to nPl - 1 do
    180     if G.RO[p1] <> nil then
     180    if G.RO[p1] <> nil then begin
    181181      Result := True;
     182      Break;
     183    end;
    182184end;
    183185
     
    373375          if Abs(dx) + Abs(dy) = 2 then
    374376            if Server(sMoveUnit - sExecute + dx and 7 shl 4 + dy and
    375               7 shl 7, Me, uix, nil^) >= rExecuted then
    376               Result := False;
     377              7 shl 7, Me, uix, nil^) >= rExecuted then begin
     378                Result := False;
     379                Exit;
     380              end;
    377381end;
    378382
     
    608612                  dx := fix and 3 shl 1 - 3 + (dy + 3) and 1;
    609613                  Loc1 := dLoc(MyCity[cix].Loc, dx, dy);
    610                   if MarkCitiesAround(Loc1, cix) then
     614                  if MarkCitiesAround(Loc1, cix) then begin
    611615                    Done := False;
     616                    Break;
     617                  end;
    612618                end;
    613619              Server(sSetCityTiles, Me, cix, Advice.Tiles);
     
    664670        dx := fix and 3 shl 1 - 3 + (dy + 3) and 1;
    665671        Loc1 := dLoc(MyCity[cix].Loc, dx, dy);
    666         if MarkCitiesAround(Loc1, cix) then
     672        if MarkCitiesAround(Loc1, cix) then begin
    667673          Done := False;
     674          Break;
     675        end;
    668676      end;
    669677    if not Done then
Note: See TracChangeset for help on using the changeset viewer.