X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=TCImplementation.cpp;h=5a754c708fb971ca9f470f3a4a178d0a0b9b4d09;hb=9db8f89e9dbf9e1d61a12d0e6094c4db0b7111e4;hp=723a2b911bf1e00edc986980c7f669f2b7b976f9;hpb=5b209950c7b0533b3082fcc2bde5fce1cf2fe632;p=SXSI%2FTextCollection.git diff --git a/TCImplementation.cpp b/TCImplementation.cpp index 723a2b9..5a754c7 100644 --- a/TCImplementation.cpp +++ b/TCImplementation.cpp @@ -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); }