summaryrefslogtreecommitdiff
path: root/boost/algorithm/searching/boyer_moore.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:24:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:25:39 +0900
commit4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch)
treefd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/algorithm/searching/boyer_moore.hpp
parentb5c87084afaef42b2d058f68091be31988a6a874 (diff)
downloadboost-upstream/1.65.0.tar.gz
boost-upstream/1.65.0.tar.bz2
boost-upstream/1.65.0.zip
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/algorithm/searching/boyer_moore.hpp')
-rw-r--r--boost/algorithm/searching/boyer_moore.hpp16
1 files changed, 8 insertions, 8 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 );