From 213cfbb050dfe67799cf0d8ee44cba21d23ee24b Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 23 Sep 2006 15:12:10 +0000 Subject: [PATCH] set crosschecks inline --- xwords4/common/engine.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/xwords4/common/engine.c b/xwords4/common/engine.c index dfd65f43b..60ec9773a 100644 --- a/xwords4/common/engine.c +++ b/xwords4/common/engine.c @@ -592,19 +592,6 @@ lookup( DictionaryCtxt* dict, array_edge* edge, Tile* buf, XP_U16 tileIndex, return XP_FALSE; } /* lookup */ -static void -setCheck( Crosscheck* check, Tile tile ) -{ - CrossBits* ptr = &check->bits[0]; - XP_ASSERT( tile < MAX_UNIQUE_TILES ); - while ( tile > 31 ) { - ++ptr; - tile -= 32; - XP_ASSERT( tile <= 31 ); /* only iterate once!!! */ - } - *ptr |= 1L << tile; -} /* setCheck */ - static void figureCrosschecks( EngineCtxt* engine, XP_U16 x, XP_U16 y, XP_U16* scoreP, Crosscheck* check ) @@ -702,7 +689,9 @@ figureCrosschecks( EngineCtxt* engine, XP_U16 x, XP_U16 y, XP_U16* scoreP, XP_ASSERT( tile < MAX_UNIQUE_TILES ); tiles[0] = tile; if ( lookup( dict, in_edge, tiles, 0, tilesAfter ) ) { - setCheck( check, tile ); + XP_ASSERT( (tile >> 5) + < (sizeof(check->bits)/sizeof(check->bits[0])) ); + check->bits[tile>>5] |= (1 << (tile & 0x1F)); } if ( IS_LAST_EDGE(dict,candidateEdge ) ) {