]> git.lizzy.rs Git - rust.git/commitdiff
Augment a comment.
authorNicholas Nethercote <n.nethercote@gmail.com>
Wed, 25 May 2022 04:47:28 +0000 (14:47 +1000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Wed, 25 May 2022 22:56:49 +0000 (08:56 +1000)
compiler/rustc_span/src/lib.rs

index 8737e45487e9088bca701491341b0141b1e611c2..f44eac63cef10a2e7460c0a93008adaf8404941c 100644 (file)
@@ -1270,7 +1270,9 @@ fn encode(&self, s: &mut S) -> Result<(), S::Error> {
                     // the lines list is sorted and individual lines are
                     // probably not that long. Because of that we can store lines
                     // as a difference list, using as little space as possible
-                    // for the differences.
+                    // for the differences. But note that the first line is
+                    // always encoded as a `BytePos` because its position is
+                    // often much larger than any of the differences.
                     let max_line_length = if lines.len() == 1 {
                         0
                     } else {