[PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
index 3d7004d..a35f61d 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
@@ -230,8 +230,8 @@ public PackWriter(final Repository repo, final ProgressMonitor monitor) {
 	public PackWriter(final Repository repo, final ProgressMonitor imonitor,
 			final ProgressMonitor wmonitor) {
 		this.db = repo;
-		initMonitor = (imonitor == null ? new NullProgressMonitor() : imonitor);
-		writeMonitor = (wmonitor == null ? new NullProgressMonitor() : wmonitor);
+		initMonitor = imonitor == null ? NullProgressMonitor.INSTANCE : imonitor;
+		writeMonitor = wmonitor == null ? NullProgressMonitor.INSTANCE : wmonitor;
 		this.deflater = new Deflater(db.getConfig().getCore().getCompression());
 		outputVersion = repo.getConfig().getCore().getPackIndexVersion();
 	}
@@ -829,17 +829,18 @@ private ObjectWalk setUpWalker(
 			RevObject o = walker.parseAny(id);
 			walker.markStart(o);
 		}
-		if (uninterestingObjects != null)
-		for (ObjectId id : uninterestingObjects) {
-			final RevObject o;
-			try {
-				o = walker.parseAny(id);
-			} catch (MissingObjectException x) {
-				if (ignoreMissingUninteresting)
-					continue;
-				throw x;
+		if (uninterestingObjects != null) {
+			for (ObjectId id : uninterestingObjects) {
+				final RevObject o;
+				try {
+					o = walker.parseAny(id);
+				} catch (MissingObjectException x) {
+					if (ignoreMissingUninteresting)
+						continue;
+					throw x;
+				}
+				walker.markUninteresting(o);
 			}
-			walker.markUninteresting(o);
 		}
 		return walker;
 	}
-- 
1.6.2.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]