Author: cazfi
Date: Sun Nov  8 20:15:00 2015
New Revision: 30480

URL: http://svn.gna.org/viewcvs/freeciv?rev=30480&view=rev
Log:
Turned tile_has_extra() to an macro to avoid function call overhead.

See patch #6549

Modified:
    trunk/common/tile.c
    trunk/common/tile.h

Modified: trunk/common/tile.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/tile.c?rev=30480&r1=30479&r2=30480&view=diff
==============================================================================
--- trunk/common/tile.c (original)
+++ trunk/common/tile.c Sun Nov  8 20:15:00 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: trunk/common/tile.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/tile.h?rev=30480&r1=30479&r2=30480&view=diff
==============================================================================
--- trunk/common/tile.h (original)
+++ trunk/common/tile.h Sun Nov  8 20:15:00 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

Reply via email to