about summary refs log tree commit diff
path: root/src/string.rs
diff options
context:
space:
mode:
authorPazzaz <pazzaz.sundqvist@gmail.com>2018-05-24 19:50:34 +0200
committerPazzaz <pazzaz.sundqvist@gmail.com>2018-05-24 21:32:01 +0200
commita1d137116bc616f9bbf78aba3546da489091c9e6 (patch)
tree7c4c76639373acab5162c5463511f0f8fa9c4420 /src/string.rs
parenta92a1cb51283bc6861bb1bb33b2b34c36b5d16bd (diff)
Avoid unnecessary comparisons with cur_end
Diffstat (limited to 'src/string.rs')
-rw-r--r--src/string.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string.rs b/src/string.rs
index 8a6b0e685c4..f683eab7dc7 100644
--- a/src/string.rs
+++ b/src/string.rs
@@ -105,12 +105,12 @@ pub fn rewrite_string<'a>(
                         while !(punctuation.contains(graphemes[cur_end - 1])
                             || graphemes[cur_end - 1].trim().is_empty())
                         {
-                            if cur_end >= graphemes.len() {
+                            cur_end += 1;
+                            if cur_end == graphemes.len() {
                                 let line = &graphemes[cur_start..].join("");
                                 result.push_str(line);
                                 break 'outer;
                             }
-                            cur_end += 1;
                         }
                         break;
                     }