From 6643c80d0302237bb718e6326270bdd317c13819 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 4 Mar 2011 01:30:05 +0000 Subject: [PATCH] [controller] optimise GetLog --- SparkleShare/SparkleController.cs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index b7d990e1..67c9b282 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -219,21 +219,13 @@ namespace SparkleShare { string path = Path.Combine (SparklePaths.SparklePath, name); int log_size = 30; - List list = new List (); - 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); + } + return null; } @@ -294,6 +286,9 @@ namespace SparkleShare { foreach (SparkleCommit change_set in activity_day) { string event_entry = "
"; + + if (change_set.IsMerge) + event_entry += "
Merged a branch
"; if (change_set.Edited.Count > 0) { @@ -317,9 +312,6 @@ namespace SparkleShare { } } - - if (change_set.IsMerge) - event_entry += "
Merged a branch
"; if (change_set.Added.Count > 0) {