]> git.lizzy.rs Git - rust.git/commitdiff
Use debug_assert_eq! to avoid comparing PathBuf on release
authortopecongiro <seuchida@gmail.com>
Sun, 18 Feb 2018 09:11:38 +0000 (18:11 +0900)
committertopecongiro <seuchida@gmail.com>
Mon, 19 Feb 2018 03:52:40 +0000 (12:52 +0900)
Comparing `PathBuf` adds noticeable overhead, avoid it in release build.

rustfmt-core/src/codemap.rs

index 7292f7f35d1e1d4ce0e478116c444c0c76118eb4..6edfb5b8fbe9b94c2bf5f12303066d681ac1b696 100644 (file)
@@ -71,7 +71,7 @@ fn lookup_line_range(&self, span: Span) -> LineRange {
         let lo = self.lookup_line(span.lo()).unwrap();
         let hi = self.lookup_line(span.hi()).unwrap();
 
-        assert_eq!(
+        debug_assert_eq!(
             lo.fm.name, hi.fm.name,
             "span crossed file boundary: lo: {:?}, hi: {:?}",
             lo, hi