diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-07-01 15:40:00 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-09-21 15:24:55 +0000 |
commit | 255279b91ecc1872539f469453b6cb05ccb75b37 (patch) | |
tree | d2f7403fa8932984d88faee3ef283cc71e17c709 | |
parent | ea3789f6a2b868d9f440ddece64142d3a2cbcf1c (diff) | |
download | gcc-255279b91ecc1872539f469453b6cb05ccb75b37.zip gcc-255279b91ecc1872539f469453b6cb05ccb75b37.tar.gz gcc-255279b91ecc1872539f469453b6cb05ccb75b37.tar.bz2 |
[Ada] Simplify iteration when printing error message spans
gcc/ada/
* errout.adb (Write_Source_Code_Lines): Use Cur_Loc before
incrementing it, so that we don't need to decrement it.
-rw-r--r-- | gcc/ada/errout.adb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index c859d8c..0b10d41 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -2693,9 +2693,7 @@ package body Errout is Write_Buffer_Char (Buf, Cur_Loc); end if; - Cur_Loc := Cur_Loc + 1; - - if Buf (Cur_Loc - 1) = ASCII.LF then + if Buf (Cur_Loc) = ASCII.LF then Cur_Line := Cur_Line + 1; -- Output ... for skipped lines @@ -2720,6 +2718,8 @@ package body Errout is Width); end if; end if; + + Cur_Loc := Cur_Loc + 1; end loop; end; |