Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache results of the IsBatchingAvaiable method per connection type
- Loading branch information
Showing
2 changed files
with
46 additions
and
32 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
6dc93e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about making it as a
IsBatchingAvailable
-extension method onIStorageConnection
, still with a cache but without any duplicated logic.6dc93e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be hard to cache the results. If we made caching dictionary static, it will be hard to set up the mocks for unit testing. I don't believe there will be other usages of this method in the near future and I think it will be better to leave this as is and wait for the third duplication.