patchFreeciv - Patches: patch #3800, activity_type_iterate()...

 
 
Show feedback again

patch #3800: activity_type_iterate() optimization

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Tue 26 Mar 2013 07:53:06 AM UTC  
 
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 31 Mar 2013 12:46:15 AM UTC, SVN revision 22631:

Collect real activities to an array when program is first launched.
activity_type_iterate() uses that array instead of checking every activity
if it's real or not.

See patch #3800

(Browse SVN revision 22631)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 26 Mar 2013 07:53:06 AM UTC, original submission:

It doesn't change during program execution what activity types are real, and we have quite a many unreal holes in activities enum already. It makes no sense that all these holes are checked every time activities are iterated.

Collect real activities to separate array on program start. activity_type_iterate() goes over that array instead of all activities and checking if activity is real by itself. Converted gtk-clients' unitselect dialog to use activity_type_iterate() instead of their own iterations, identical to old activity_type_iterate().

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17547:  ActTypeIterOptim.patch added by cazfi (9kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 31 Mar 2013 12:46:26 AM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Tue 26 Mar 2013 07:53:06 AM UTCcazfiAttached File-=>Added ActTypeIterOptim.patch, #17547
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup