Skip to content

Commit

Permalink
Avoid unnecessary comparisons with cur_end
Browse files Browse the repository at this point in the history
  • Loading branch information
Pazzaz committed May 24, 2018
1 parent a92a1cb commit a1d1371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/string.rs
Expand Up @@ -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;
}
Expand Down

0 comments on commit a1d1371

Please sign in to comment.