[Freeciv-tickets] [freeciv] #45602: is_..._in_range() with a standardized fingerprint

Back to archive index
OSDN Ticket System norep****@osdn*****
Sun Oct 30 03:22:14 JST 2022


#45602: is_..._in_range() with a standardized fingerprint

  Open Date: 2022-09-07 18:44
Last Update: 2022-10-29 21:22

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/45602
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45602

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-10-29 21:22 Updated by: cazfi

Comment:

Reply To alienvalkyrie
For the record, I do think this change is already worth it for the sake of abstraction and consistency, irrespective of efficiency gains; so it would still be justified to push it even without profiling data to back it up.
Agreed. I'll try to do some profiling for it at some point, but there's no need to wait for those results before pushing this in.
To have sensible comparisons of two runs (with and without the patch), I would need a moment when there's no other heavy processes going on the same machine and interfering. Usually there's always a couple of builds and/or autogames going.

---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: alienvalkyrie
          Type: Patches
        Status: Open [Owner assigned]
      Priority: 5 - Medium
     MileStone: 3.1.0
     Component: General
      Severity: 5 - Medium
    Resolution: Accepted
---------------------------------------------------------------------

Ticket details:

Looking to make is_req_active()
I think the main problem is that those 'case's in the switch are different from each other. The compiled code really need to go "if else if else if else if else if else" to find the block for the requirement type they are interested about. It would be much better to have all cases to call similar callback function -> then we could have those callbacks in an array indexed by the requirement type id.
With the new req_context this makes even more sense than before. is_req_active() can just pass the context pointer as it got it, to the callbacks. There's no "passing parameters needed by the particular callback"
The req_context point makes it clear that the change won't get backported to S3_0, where we don't have that context.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/45602
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=45602



More information about the Freeciv-tickets mailing list
Back to archive index