Browse Source

Minor in GetPrefixedWords

Alexey N. Vinogradov 5 years ago
parent
commit
173ac075f2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/indexformat.cpp

+ 2 - 1
src/indexformat.cpp

@@ -506,7 +506,8 @@ void CWordlist::GetPrefixedWords ( const char * sSubstring, int iSubLen, const c
 	int dWildcard [ SPH_MAX_WORD_LEN + 1 ];
 	int * pWildcard = ( sphIsUTF8 ( sWildcard ) && sphUTF8ToWideChar ( sWildcard, dWildcard, SPH_MAX_WORD_LEN ) ) ? dWildcard : NULL;
 
-	const CSphWordlistCheckpoint * pCheckpoint = FindCheckpoint ( sSubstring, iSubLen, 0, true );
+	// assume dict=crc never has word with wordid=0, however just don't consider it and explicitly set nullptr.
+	const CSphWordlistCheckpoint * pCheckpoint = m_bWordDict ? FindCheckpoint ( sSubstring, iSubLen, 0, true ) : nullptr;
 	const int iSkipMagic = ( BYTE(*sSubstring)<0x20 ); // whether to skip heading magic chars in the prefix, like NONSTEMMED maker
 	while ( pCheckpoint )
 	{