diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2016-10-03 18:58:35 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2016-10-03 19:02:33 +1100 |
| commit | 9e3dcb45493366c790d333aaf4dfa5a043e49a63 (patch) | |
| tree | 250aebaa9bb4014ad93c6e4392aec8cc4fca3932 /src/libsyntax/parse | |
| parent | 49960ad2503eb050e02c6c428111a59d5bc16ba3 (diff) | |
| download | rust-9e3dcb45493366c790d333aaf4dfa5a043e49a63.tar.gz rust-9e3dcb45493366c790d333aaf4dfa5a043e49a63.zip | |
Simplify `start_bpos` calculation in scan_comment().
The two branches of this `if` compute the same value. This commit gets rid of the first branch, which makes this calculation identical to the one in scan_block_comment().
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 1b326aeb8ea..0ba2db3310c 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -507,11 +507,7 @@ impl<'a> StringReader<'a> { // line comments starting with "///" or "//!" are doc-comments let doc_comment = self.curr_is('/') || self.curr_is('!'); - let start_bpos = if doc_comment { - self.pos - BytePos(3) - } else { - self.last_pos - BytePos(2) - }; + let start_bpos = self.last_pos - BytePos(2); while !self.is_eof() { match self.curr.unwrap() { |
