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/LocalPlayer/Draft.pas

    r536 r549  
    307307      for I := 0 to Lines - 1 do
    308308      begin
    309         if not(Code[I] in AutoFeature) then
     309        if not (Code[I] in AutoFeature) then
    310310        begin
    311311          // paint +/- butttons
     
    458458procedure TDraftDlg.FormShow(Sender: TObject);
    459459var
    460   count, D, I: Integer;
     460  Count, D, I: Integer;
    461461begin
    462462  Domain := dGround;
     
    465465    Inc(Domain);
    466466
    467   // count max number of features in any domain
     467  // Count max number of features in any domain
    468468  MaxLines := 0;
    469469  for D := 0 to nDomains - 1 do
     
    471471      (MyRO.Tech[upgrade[D, 0].Preq] >= tsApplicable) then
    472472    begin
    473       count := 0;
     473      Count := 0;
    474474      for I := 0 to nFeature - 1 do
    475475        if IsFeatureInList(D, I) then
    476           Inc(count);
    477       if count > MaxLines then
    478         MaxLines := count;
     476          Inc(Count);
     477      if Count > MaxLines then
     478        MaxLines := Count;
    479479    end;
    480480  Cut := (MaxLines0 - MaxLines) * LinePitch;
Note: See TracChangeset for help on using the changeset viewer.