Author: cazfi Date: Sun Nov 8 20:15:06 2015 New Revision: 30481 URL: http://svn.gna.org/viewcvs/freeciv?rev=30481&view=rev Log: Turned tile_has_extra() to an macro to avoid function call overhead.
See patch #6549 Modified: branches/S2_6/common/tile.c branches/S2_6/common/tile.h Modified: branches/S2_6/common/tile.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/tile.c?rev=30481&r1=30480&r2=30481&view=diff ============================================================================== --- branches/S2_6/common/tile.c (original) +++ branches/S2_6/common/tile.c Sun Nov 8 20:15:06 2015 @@ -837,14 +837,6 @@ } /**************************************************************************** - Returns TRUE if the given tile has a road of given type on it. -****************************************************************************/ -bool tile_has_extra(const struct tile *ptile, const struct extra_type *pextra) -{ - return BV_ISSET(ptile->extras, extra_index(pextra)); -} - -/**************************************************************************** Returns TRUE if the given tile has a extra conflicting with the given one. ****************************************************************************/ bool tile_has_conflicting_extra(const struct tile *ptile, Modified: branches/S2_6/common/tile.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/tile.h?rev=30481&r1=30480&r2=30481&view=diff ============================================================================== --- branches/S2_6/common/tile.h (original) +++ branches/S2_6/common/tile.h Sun Nov 8 20:15:06 2015 @@ -138,7 +138,7 @@ bool tile_extra_apply(struct tile *ptile, struct extra_type *tgt); bool tile_extra_rm_apply(struct tile *ptile, struct extra_type *tgt); -bool tile_has_extra(const struct tile *ptile, const struct extra_type *pextra); +#define tile_has_extra(ptile, pextra) BV_ISSET(ptile->extras, extra_index(pextra)) bool tile_has_conflicting_extra(const struct tile *ptile, const struct extra_type *pextra); bool tile_has_visible_extra(const struct tile *ptile, const struct extra_type *pextra); bool tile_has_cause_extra(const struct tile *ptile, enum extra_cause cause); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits