Skip to content

Instantly share code, notes, and snippets.

@tomatolog
Created November 7, 2012 07:39
Show Gist options
  • Save tomatolog/4030048 to your computer and use it in GitHub Desktop.
Save tomatolog/4030048 to your computer and use it in GitHub Desktop.
patch
diff --git a/src/sphinxsearch.cpp b/src/sphinxsearch.cpp
index 7919117..d1276dd 100644
--- a/src/sphinxsearch.cpp
+++ b/src/sphinxsearch.cpp
@@ -510,16 +510,6 @@ class FSMphrase
protected:
struct State_t
{
- State_t ()
- {
- }
-
- State_t ( int iTagQword, int iExpHitpos )
- : m_iTagQword ( iTagQword )
- , m_iExpHitpos ( iExpHitpos )
- {
- }
-
int m_iTagQword;
int m_iExpHitpos;
};
@@ -537,7 +527,7 @@ protected:
protected:
CSphVector<int> m_dQposDelta; ///< next expected qpos delta for each existing qpos (for skipped stopwords case)
CSphVector<int> m_dAtomPos; ///< lets use it as finite automata states and keep references on it
- CSphVector < State_t > m_dStates; ///< pointers to states of finite automata
+ CSphVector<State_t> m_dStates; ///< pointers to states of finite automata
};
/// exact phrase streamer
typedef ExtNWay_c < FSMphrase > ExtPhrase_c;
@@ -2697,7 +2687,11 @@ inline bool FSMphrase::HitFSM ( const ExtHit_t* pHit, ExtHit_t* dTarget )
// adding start state for start hit
if ( pHit->m_uQuerypos==m_dAtomPos[0] )
- m_dStates.Add ( State_t ( 0, iHitpos + m_dQposDelta[0] ) );
+ {
+ State_t & tState = m_dStates.Add();
+ tState.m_iTagQword = 0;
+ tState.m_iExpHitpos = iHitpos + m_dQposDelta[0];
+ }
// updating states
for ( int i=m_dStates.GetLength()-1; i>=0; i-- )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment