patchFreeciv - Patches: patch #3876, Remove redundant...

 
 
Show feedback again

patch #3876: Remove redundant tile_remove_base() call

Submitted by:  Emmet Hikory <persia>
Submitted on:  Mon 22 Apr 2013 09:54:53 PM 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 28 Apr 2013 08:27:50 PM UTC, SVN revision 22787:

Removed duplicate tile_remove_base() call from tile_change_terrain()

Patch by Emmet Hikory

See patch #3876

(Browse SVN revision 22787)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 22 Apr 2013 09:54:53 PM UTC, original submission:

Extracted from discussion in patch #3826

tile.c:tile_change_terrain() checks if fc_funcs->destroy_base is set, and
either calls the callback or calls tile_remove_base() if the callback is unset. Then, just to make sure, tile_remove_base() is called again. fc_funcs->destroy_base is set to NULL for the client and maphand.c:destroy_base() for the server, which function also calls tile_remove_base().

In practice, this means that for calls from the client, tile_remove_base() is called twice in immediate succession within tile_change_terrain(), and for calls from the server, tile_remove_base() is called from destroy_base() and then immediately thereafter from tile_change_terrain().

This patch removes the redundant call and adds a comment indicating that the code assumes that tile_remove_base() will be called by any function assigned to fc_funcs->destroy_base().

Emmet Hikory <persia>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #17810:  remove-redundant-tile_remove_base-call.patch added by persia (880B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Updated the item)
  • -unavailable- added by persia (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 28 Apr 2013 08:28:00 PM UTCcazfiStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Mon 22 Apr 2013 10:13:53 PM UTCcazfiStatusNone=>Ready For Test
      Assigned toNone=>cazfi
      Planned Release=>2.5.0
    Mon 22 Apr 2013 09:54:53 PM UTCpersiaAttached File-=>Added remove-redundant-tile_remove_base-call.patch, #17810
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup