perf: Skip re-installing already up-to-date symlinks
Assisted-by: Claude Opus 4.6 via pi
diff --git a/src/main.rs b/src/main.rs
index 5bb135c..7306412 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -253,7 +253,13 @@ fn symlink_entries(
let name = entry.file_name();
let symlink_path = target_dir.join(&name);
- if symlink_path.symlink_metadata().is_ok() {
+ // Skip if the symlink already points to the right place
+ if let Ok(existing) = fs_err::read_link(&symlink_path) {
+ if existing == entry.path() {
+ info!("up-to-date {subdir} {}", name.to_string_lossy());
+ installed.insert(name);
+ continue;
+ }
fs_err::remove_file(&symlink_path)?;
}