Permalink
Browse files

Modified the if statement to have the true condition first.

  • Loading branch information...
1 parent 062da8d commit 4f16c199e9245743e0caabf82509cada009a375a @nufyoot nufyoot committed May 14, 2012
Showing with 4 additions and 10 deletions.
  1. +4 −10 SeeGitApp/Models/RepositoryGraphBuilder.cs
View
14 SeeGitApp/Models/RepositoryGraphBuilder.cs
@@ -88,15 +88,9 @@ private void AddCommitsToGraph(Commit commit, CommitVertex childVertex)
if (childVertex != null)
{
var edge = new CommitEdge(childVertex, commitVertex);
- if (!_edges.ContainsKey(edge.Id))
- {
- _graph.AddEdge(edge);
- _edges.Add(edge.Id, edge);
- }
- else
- {
- return;
- }
+ if (_edges.ContainsKey(edge.Id)) return;
+ _graph.AddEdge(edge);
+ _edges.Add(edge.Id, edge);
}
foreach (var parent in commit.Parents)
@@ -110,7 +104,7 @@ private CommitVertex GetCommitVertex(Commit commit)
CommitVertex commitVertex;
if (!_vertices.TryGetValue(commit.Sha, out commitVertex))
{
- commitVertex = new CommitVertex(commit.Sha, commit.MessageShort) {Description = commit.Message};
+ commitVertex = new CommitVertex(commit.Sha, commit.MessageShort) { Description = commit.Message };
_vertices.Add(commit.Sha, commitVertex);
}

0 comments on commit 4f16c19

Please sign in to comment.