[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[hunspell] 01/03: Imported Upstream version 1.4.1



This is an automated email from the git hooks/post-receive script.

rene pushed a commit to branch experimental
in repository hunspell.

commit c2fbd30098cc4a5d734ee7bf9f394c4f5ef01367
Author: Rene Engelhard <rene@debian.org>
Date:   Tue May 3 10:20:46 2016 +0200

    Imported Upstream version 1.4.1
---
 src/hunspell/csutil.cxx     | 2 +-
 src/hunspell/suggestmgr.cxx | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/hunspell/csutil.cxx b/src/hunspell/csutil.cxx
index b1473a3..1948e4a 100644
--- a/src/hunspell/csutil.cxx
+++ b/src/hunspell/csutil.cxx
@@ -2783,7 +2783,7 @@ class is_any_of {
   bool operator()(char c) { return chars.find(c) != std::string::npos; }
 
  private:
-  const std::string& chars;
+  std::string chars;
 };
 }
 
diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
index a6c83d5..17becd7 100644
--- a/src/hunspell/suggestmgr.cxx
+++ b/src/hunspell/suggestmgr.cxx
@@ -1088,10 +1088,10 @@ int SuggestMgr::movechar(char** wlst,
     std::copy(word, word + candidate.size(), candidate.begin());
   }
 
-  for (std::string::iterator p = candidate.begin() + candidate.size() - 1; p > candidate.begin(); --p) {
-    for (std::string::iterator q = p - 1; q >= candidate.begin() && std::distance(q, p) < 10; --q) {
-      std::swap(*q, *(q + 1));
-      if (std::distance(q, p) < 2)
+  for (std::string::reverse_iterator p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
+    for (std::string::reverse_iterator q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) < 10; ++q) {
+      std::swap(*q, *(q - 1));
+      if (std::distance(p, q) < 2)
         continue;  // omit swap char
       ns = testsug(wlst, candidate.c_str(), candidate.size(), ns, cpdsuggest, NULL, NULL);
       if (ns == -1)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/hunspell.git


Reply to: