File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/GitVersion.LibGit2Sharp/Git Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,16 @@ namespace GitVersion.Git;
66internal sealed class CommitCollection : ICommitCollection
77{
88 private readonly ICommitLog innerCollection ;
9+ private readonly Lazy < IReadOnlyCollection < ICommit > > commits ;
910
10- internal CommitCollection ( ICommitLog collection ) => this . innerCollection = collection . NotNull ( ) ;
11+ internal CommitCollection ( ICommitLog collection )
12+ {
13+ this . innerCollection = collection . NotNull ( ) ;
14+ this . commits = new Lazy < IReadOnlyCollection < ICommit > > ( ( ) => this . innerCollection . Select ( commit => new Commit ( commit ) ) . ToArray ( ) ) ;
15+ }
1116
1217 public IEnumerator < ICommit > GetEnumerator ( )
13- => this . innerCollection . Select ( commit => new Commit ( commit ) ) . GetEnumerator ( ) ;
18+ => this . commits . Value . GetEnumerator ( ) ;
1419
1520 IEnumerator IEnumerable . GetEnumerator ( ) => GetEnumerator ( ) ;
1621
You can’t perform that action at this time.
0 commit comments