Clarify why we return early

html_output
Wilfred Hughes 2022-02-03 21:05:54 +07:00
parent 0dcb76eec1
commit 635ef12f84
1 changed files with 2 additions and 1 deletions

@ -415,7 +415,8 @@ fn diff_file_content(display_path: &str, lhs_bytes: &[u8], rhs_bytes: &[u8]) ->
let ts_lang = guess(path, guess_src).map(tsp::from_language);
if lhs_bytes == rhs_bytes {
// TODO: explain rationale here.
// If the two files are completely identical, return early
// rather than doing any more work.
return DiffResult {
path: display_path.into(),
language: ts_lang.map(|l| l.name.into()),