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

Show feedback again

patch #3800: activity_type_iterate() optimization

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

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Sun Mar 31 00:46:15 2013, 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 Mar 26 07:53:06 2013, 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):

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.


    Error: not logged in



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Mar 31 00:46:26 2013cazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
    Tue Mar 26 07:53:06 2013cazfiAttached File-=>Added ActTypeIterOptim.patch, #17547
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup