Don't return content in response if it's unchanged

This commit is contained in:
Andras Schmelczer 2025-01-04 12:32:18 +00:00
parent 3ae0e7b896
commit c41ce7ef68
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 113 additions and 32 deletions

View file

@ -9,6 +9,7 @@ use crate::tokenizer::Tokenizer;
#[must_use]
pub fn reconcile(original: &str, left: &str, right: &str) -> String {
// Common trivial cases
if left == right {
return left.to_owned();
}
@ -21,6 +22,7 @@ pub fn reconcile(original: &str, left: &str, right: &str) -> String {
return left.to_owned();
}
// 3-way merge
let left_operations = EditedText::from_strings(original, left);
let right_operations = EditedText::from_strings(original, right);