[controller] optimise GetLog

This commit is contained in:
Hylke Bons 2011-03-04 01:30:05 +00:00
parent 69e8c39d12
commit 6643c80d03

View file

@ -219,18 +219,10 @@ namespace SparkleShare {
string path = Path.Combine (SparklePaths.SparklePath, name);
int log_size = 30;
List <SparkleCommit> list = new List <SparkleCommit> ();
foreach (SparkleRepo repo in Repositories) {
if (repo.LocalPath.Equals (path)) {
foreach (SparkleCommit commit in repo.GetCommits (log_size))
list.Add (commit);
return list;
}
if (repo.LocalPath.Equals (path))
return repo.GetCommits (log_size);
}
@ -295,6 +287,9 @@ namespace SparkleShare {
string event_entry = "<dl>";
if (change_set.IsMerge)
event_entry += "<dt>Merged a branch</dt>";
if (change_set.Edited.Count > 0) {
event_entry += "<dt>Edited</dt>";
@ -318,9 +313,6 @@ namespace SparkleShare {
}
if (change_set.IsMerge)
event_entry += "<dt>Merged a branch</dt>";
if (change_set.Added.Count > 0) {
event_entry += "<dt>Added</dt>";