-
-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache projectile-project-root for performance (#1149)
Cache the result of (projectile-project-root) as a buffer local variable to increase performance - this is implemented the same as was done for (projectile-project-name) in PR 1906. To ensure project root cache is used when there is no project (ie. when (projectile-project-root) is nil) - we set the cached value to the symbol 'none' and then replace this with nil before we return it - since the cached value is non-nil we don't reevaluate it - but we don't want to return 'none' as a result - so we instead substitute 'none' for nil before returning, and also move the `projectile-require-project-root` error check to the exit of the function to ensure this is still raised in this case. Finally, this commit also changes the unit tests to handle the cached project root by resetting before each evaluation - since the unit tests don't actually change the (buffer-file-name) we need to do this to ensure they still pass.
- Loading branch information
1 parent
5dea114
commit 7951b17
Showing
3 changed files
with
64 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters