summaryrefslogtreecommitdiff
path: root/boost/algorithm/searching
diff options
context:
space:
mode:
Diffstat (limited to 'boost/algorithm/searching')
-rw-r--r--boost/algorithm/searching/boyer_moore.hpp16
-rw-r--r--boost/algorithm/searching/knuth_morris_pratt.hpp6
2 files changed, 11 insertions, 11 deletions
diff --git a/boost/algorithm/searching/boyer_moore.hpp b/boost/algorithm/searching/boyer_moore.hpp
index 65a809dd4f..192d4dec25 100644
--- a/boost/algorithm/searching/boyer_moore.hpp
+++ b/boost/algorithm/searching/boyer_moore.hpp
@@ -152,8 +152,8 @@ Requirements:
template<typename Iter, typename Container>
- void compute_bm_prefix ( Iter pat_first, Iter pat_last, Container &prefix ) {
- const std::size_t count = std::distance ( pat_first, pat_last );
+ void compute_bm_prefix ( Iter first, Iter last, Container &prefix ) {
+ const std::size_t count = std::distance ( first, last );
BOOST_ASSERT ( count > 0 );
BOOST_ASSERT ( prefix.size () == count );
@@ -161,26 +161,26 @@ Requirements:
std::size_t k = 0;
for ( std::size_t i = 1; i < count; ++i ) {
BOOST_ASSERT ( k < count );
- while ( k > 0 && ( pat_first[k] != pat_first[i] )) {
+ while ( k > 0 && ( first[k] != first[i] )) {
BOOST_ASSERT ( k < count );
k = prefix [ k - 1 ];
}
- if ( pat_first[k] == pat_first[i] )
+ if ( first[k] == first[i] )
k++;
prefix [ i ] = k;
}
}
- void build_suffix_table ( patIter pat_first, patIter pat_last ) {
- const std::size_t count = (std::size_t) std::distance ( pat_first, pat_last );
+ void build_suffix_table ( patIter first, patIter last ) {
+ const std::size_t count = (std::size_t) std::distance ( first, last );
if ( count > 0 ) { // empty pattern
std::vector<typename std::iterator_traits<patIter>::value_type> reversed(count);
- (void) std::reverse_copy ( pat_first, pat_last, reversed.begin ());
+ (void) std::reverse_copy ( first, last, reversed.begin ());
std::vector<difference_type> prefix (count);
- compute_bm_prefix ( pat_first, pat_last, prefix );
+ compute_bm_prefix ( first, last, prefix );
std::vector<difference_type> prefix_reversed (count);
compute_bm_prefix ( reversed.begin (), reversed.end (), prefix_reversed );
diff --git a/boost/algorithm/searching/knuth_morris_pratt.hpp b/boost/algorithm/searching/knuth_morris_pratt.hpp
index c890c9cac0..5b5b64a729 100644
--- a/boost/algorithm/searching/knuth_morris_pratt.hpp
+++ b/boost/algorithm/searching/knuth_morris_pratt.hpp
@@ -155,9 +155,9 @@ namespace boost { namespace algorithm {
void preKmp ( patIter first, patIter last ) {
- const /*std::size_t*/ int count = std::distance ( first, last );
+ const difference_type count = std::distance ( first, last );
- int i, j;
+ difference_type i, j;
i = 0;
j = skip_[0] = -1;
@@ -177,7 +177,7 @@ namespace boost { namespace algorithm {
void init_skip_table ( patIter first, patIter last ) {
const difference_type count = std::distance ( first, last );
- int j;
+ difference_type j;
skip_ [ 0 ] = -1;
for ( int i = 1; i <= count; ++i ) {
j = skip_ [ i - 1 ];