Small fixes
authornvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 27 Mar 2009 15:48:17 +0000 (15:48 +0000)
committernvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 27 Mar 2009 15:48:17 +0000 (15:48 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@298 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

TCImplementation.cpp

index 723a2b9..5a754c7 100644 (file)
@@ -378,16 +378,7 @@ TextCollection::document_result TCImplementation::Prefix(uchar const * pattern)
 
     TextPosition sp = 0, ep = 0;
     Search(pattern, m, &sp, &ep);
-
-    TextCollection::document_result result;
     
-    // Report end-markers in result interval
-    unsigned resultSize = CountEndmarkers(sp, ep);
-    if (resultSize == 0)
-        return result;
-
-    result.reserve(resultSize); // Try to avoid reallocation.
-
     // Iterate through end-markers in [sp,ep]:
     return EnumerateEndmarkers(sp, ep);
 }
@@ -401,15 +392,6 @@ TextCollection::document_result TCImplementation::Prefix(uchar const * pattern,
     TextPosition sp = 0, ep = 0;
     Search(pattern, m, &sp, &ep);
 
-    TextCollection::document_result result;
-    
-    // Report end-markers in result interval
-    unsigned resultSize = CountEndmarkers(sp, ep);
-    if (resultSize == 0)
-        return result;
-
-    result.reserve(resultSize); // Try to avoid reallocation.
-
     // Return end-markers in [sp,ep] and [begin, end]:
     return EnumerateEndmarkers(sp, ep, begin, end);
 }
@@ -511,8 +493,6 @@ TextCollection::document_result TCImplementation::Equal(uchar const *pattern) co
     // Match including end-marker
     Search(pattern, m+1, &sp, &ep);
 
-    TextCollection::document_result result;
-
     // Report end-markers in result interval
     return EnumerateEndmarkers(sp, ep);
 }
@@ -527,8 +507,6 @@ TextCollection::document_result TCImplementation::Equal(uchar const *pattern, Do
     // Match including end-marker
     Search(pattern, m+1, &sp, &ep, begin, end);
 
-    TextCollection::document_result result;
-
     // Report end-markers in result interval
     return EnumerateEndmarkers(sp, ep, begin, end);
 }
@@ -632,8 +610,6 @@ TextCollection::document_result TCImplementation::LessThan(uchar const * pattern
     TextPosition sp = 0, ep = 0;
     SearchLessThan(pattern, m, &sp, &ep);
 
-    TextCollection::document_result result;
-    
     // Report end-markers in result interval
     return EnumerateEndmarkers(sp, ep);
 }
@@ -647,15 +623,6 @@ TextCollection::document_result TCImplementation::LessThan(uchar const * pattern
     TextPosition sp = 0, ep = 0;
     SearchLessThan(pattern, m, &sp, &ep);
 
-    TextCollection::document_result result;
-    
-    // Report end-markers in result interval
-    unsigned resultSize = CountEndmarkers(sp, ep);
-    if (resultSize == 0)
-        return result;
-
-    result.reserve(resultSize); // Try to avoid reallocation.
-
     // Iterate through end-markers in [sp,ep] and [begin, end]:
     return EnumerateEndmarkers(sp, ep, begin, end);
 }