diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2015-09-17 16:31:53 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2015-09-17 16:31:53 +0300 |
commit | 8cbfcb6036208275fde19d87fa5b60f01a3a9a14 (patch) | |
tree | adb3f77b1547e93442282da44eafb0d555350cb1 | |
parent | e4a6dee1f0f1a558b09bc9a0904d19790c0aeb7c (diff) |
[Core] Optimization when saving a project
When saving a project, don't refresh the builder if the project doesn't
actually change.
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs index 602a50ec65..e9b357fcba 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs @@ -299,10 +299,13 @@ namespace MonoDevelop.Projects return Task.Run (delegate { WriteProject (monitor); + var t = File.GetLastWriteTime (FileName); + // Doesn't save the file to disk if the content did not change sourceProject.Save (FileName); - if (projectBuilder != null) + // Check the last write time to avoid an unnecessary refresh if the file did not change + if (projectBuilder != null && t != File.GetLastWriteTime (FileName)) projectBuilder.Refresh ().Wait (); }); } |