Normalize order of `lo` and `hi` in `Span::new`

This commit is contained in:
Vadim Petrochenkov 2017-08-30 01:39:51 +03:00
parent 3da868dcb6
commit 71dfe6487d
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ pub struct MultiSpan {
impl Span {
#[inline]
pub fn new(lo: BytePos, hi: BytePos, ctxt: SyntaxContext) -> Self {
Span { lo, hi, ctxt }
if lo <= hi { Span { lo, hi, ctxt } } else { Span { lo: hi, hi: lo, ctxt } }
}
#[inline]