Browse Source

minor in schema remap

alexey 2 years ago
parent
commit
e49596eda2
1 changed files with 3 additions and 9 deletions
  1. 3 9
      src/sphinxsort.cpp

+ 3 - 9
src/sphinxsort.cpp

@@ -532,15 +532,9 @@ void MatchSorter_c::TransformPooled2StandalonePtrs ( GetBlobPoolFromMatch_fn fnB
 	if ( m_dTransformed.IsEmpty() )
 	{
 		// keep id as the first attribute
-		for ( int i = 0; i<pOldSchema->GetAttrsCount (); i++ )
-		{
-			const CSphColumnInfo & tAttr = pOldSchema->GetAttr(i);
-			if ( tAttr.m_sName==sphGetDocidName() )
-			{
-				tBuilder.AddAttr ( tAttr.m_sName );
-				break;
-			}
-		}
+		const CSphColumnInfo* pId = pOldSchema->GetAttr ( sphGetDocidName() );
+		if ( pId )
+			tBuilder.AddAttr ( sphGetDocidName() );
 
 		// add the rest
 		for ( int i = 0; i<pOldSchema->GetAttrsCount (); i++ )