Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Paul J. Lucas
Approved revision: 11302
Merged at revision: 11588
Proposed branch: lp:~paul-lucas/zorba/pjl-misc
Merge into: lp:zorba
Diff against target: 49 lines (+9/-5)
2 files modified
src/runtime/full_text/apply.cpp (+6/-3)
src/runtime/full_text/ft_match.h (+3/-2)
To merge this branch: bzr merge lp:~paul-lucas/zorba/pjl-misc
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+178871@code.launchpad.net

Commit message

Optimization for same sentence/paragraph.

Description of the change

Optimization for same sentence/paragraph.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/178871

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/full_text/apply.cpp'
2--- src/runtime/full_text/apply.cpp 2013-06-12 00:21:05 +0000
3+++ src/runtime/full_text/apply.cpp 2013-08-07 01:20:38 +0000
4@@ -770,9 +770,12 @@
5
6 FOR_EACH( ft_all_matches, m, am ) {
7 bool every_satisfies = true;
8- FOR_EACH( ft_match::includes_t, i1, m->includes ) {
9- FOR_EACH( ft_match::includes_t, i2, m->includes ) {
10- if ( &*i1 != &*i2 && !same( *i1, *i2, sep ) ) {
11+ if ( m->includes.size() > 1 ) {
12+ ft_match::includes_t::const_iterator i( m->includes.begin() );
13+ ft_match::includes_t::const_iterator const end( m->includes.end() );
14+ ft_match::includes_t::value_type const &first = *i;
15+ while ( ++i != end ) {
16+ if ( !same( first, *i, sep ) ) {
17 every_satisfies = false;
18 break;
19 }
20
21=== modified file 'src/runtime/full_text/ft_match.h'
22--- src/runtime/full_text/ft_match.h 2013-02-07 17:24:36 +0000
23+++ src/runtime/full_text/ft_match.h 2013-08-07 01:20:38 +0000
24@@ -19,6 +19,7 @@
25
26 #include <algorithm>
27 #include <list>
28+#include <vector>
29
30 #include "ft_token_span.h"
31
32@@ -65,7 +66,7 @@
33 /**
34 * An %ft_string_matches contains zero or more ft_string_match objects.
35 */
36-typedef std::list<ft_string_match> ft_string_matches;
37+typedef std::vector<ft_string_match> ft_string_matches;
38
39 ///////////////////////////////////////////////////////////////////////////////
40
41@@ -94,7 +95,7 @@
42 if ( !includes_sorted_ ) {
43 includes_sorted_ = true;
44 #endif
45- includes.sort();
46+ std::sort( includes.begin(), includes.end() );
47 #if FT_MATCH_OPTIMIZE_SORT
48 }
49 #endif

Subscribers

People subscribed via source and target branches