assert(phrase_length > 0);
int result = SEARCH_NONE;
- /* use the lower 16-bit for bitmap index,
+ /* use the first 8-bit of the lower 16-bit for bitmap index,
* as most the higher 16-bit are zero.
*/
- guint16 first_key = phrase[0] & 0xFFFF;
+ guint8 first_key = (phrase[0] & 0xFF00) >> 8;
PhraseLengthIndexLevel * phrase_array = m_phrase_length_indexes[first_key];
if ( phrase_array )
}
int PhraseBitmapIndexLevel::add_index( int phrase_length, /* in */ ucs4_t phrase[], /* in */ phrase_token_t token){
- guint16 first_key = phrase[0] & 0xFFFF;
+ guint8 first_key = (phrase[0] & 0xFF00) >> 8;
+
PhraseLengthIndexLevel * & length_array = m_phrase_length_indexes[first_key];
if ( !length_array ){
length_array = new PhraseLengthIndexLevel();
}
int PhraseBitmapIndexLevel::remove_index( int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token){
- guint16 first_key = phrase[0] & 0xFFFF;
+ guint8 first_key = (phrase[0] & 0xFF00) >> 8;
+
PhraseLengthIndexLevel * &length_array = m_phrase_length_indexes[first_key];
if ( length_array )
return length_array->remove_index(phrase_length, phrase, token);