Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/ChangelogHelper.java @ 140:1c1891ad1c73
Slight optimization
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 16 Feb 2011 22:33:04 +0100 |
parents | 4a948ec83980 |
children | ba2bf656f00f |
comparison
equal
deleted
inserted
replaced
139:f3c387ea0a34 | 140:1c1891ad1c73 |
---|---|
31 */ | 31 */ |
32 public class ChangelogHelper { | 32 public class ChangelogHelper { |
33 private final int leftBoundary; | 33 private final int leftBoundary; |
34 private final HgRepository repo; | 34 private final HgRepository repo; |
35 private final TreeMap<Integer, Changeset> cache = new TreeMap<Integer, Changeset>(); | 35 private final TreeMap<Integer, Changeset> cache = new TreeMap<Integer, Changeset>(); |
36 private String nextCommitAuthor; | |
36 | 37 |
37 /** | 38 /** |
38 * @param hgRepo | 39 * @param hgRepo |
39 * @param leftBoundaryRevision walker never visits revisions with local numbers less than specified, | 40 * @param leftBoundaryRevision walker never visits revisions with local numbers less than specified, |
40 * IOW only revisions [leftBoundaryRevision..TIP] are considered. | 41 * IOW only revisions [leftBoundaryRevision..TIP] are considered. |
72 } | 73 } |
73 return null; | 74 return null; |
74 } | 75 } |
75 | 76 |
76 public String getNextCommitUsername() { | 77 public String getNextCommitUsername() { |
77 return new HgInternals(repo).getNextCommitUsername(); | 78 if (nextCommitAuthor == null) { |
79 nextCommitAuthor = new HgInternals(repo).getNextCommitUsername(); | |
80 } | |
81 return nextCommitAuthor; | |
78 } | 82 } |
79 } | 83 } |