Permalink
Browse files

Added changes list caching so that changes wouldn't be downloaded mul…

…tiple times if Changes property queried more then once.
  • Loading branch information...
1 parent dfb7e9a commit 7f1867fead0e78b455d28d80e1fd703ac6b4fb13 @ivan-danilov ivan-danilov committed Aug 3, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 GitTfs.VsCommon/TfsHelper.Common.cs
View
4 GitTfs.VsCommon/TfsHelper.Common.cs
@@ -257,18 +257,20 @@ class FakeChangeset : IChangeset
private readonly PendingSet _pendingSet;
private readonly IVersionControlServer _versionControlServer;
private readonly TfsApiBridge _bridge;
+ private readonly IChange[] _changes;
public FakeChangeset(Shelveset shelveset, PendingSet pendingSet, IVersionControlServer versionControlServer, TfsApiBridge bridge)
{
_shelveset = shelveset;
_versionControlServer = versionControlServer;
_bridge = bridge;
_pendingSet = pendingSet;
+ _changes = _pendingSet.PendingChanges.Select(x => new FakeChange(x, _bridge)).Cast<IChange>().ToArray();
}
public IChange[] Changes
{
- get { return _pendingSet.PendingChanges.Select(x => new FakeChange(x, _bridge)).Cast<IChange>().ToArray(); }
+ get { return _changes; }
}
public string Committer

0 comments on commit 7f1867f

Please sign in to comment.