From: Alex Blewitt <alex.blewitt@gmail.com>
To: spearce@spearce.org, robin.rosenberg@dewire.com
Cc: git@vger.kernel.org, Alex Blewitt <alex.blewitt@gmail.com>
Subject: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop
Date: Wed, 6 May 2009 21:37:04 +0100 [thread overview]
Message-ID: <1241642224-6914-2-git-send-email-alex.blewitt@gmail.com> (raw)
In-Reply-To: <1241642224-6914-1-git-send-email-alex.blewitt@gmail.com>
---
.../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
next prev parent reply other threads:[~2009-05-06 20:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-06 20:37 [PATCH 1/2] Allow monitor/unintersting objects to be null Alex Blewitt
2009-05-06 20:37 ` Alex Blewitt [this message]
2009-05-06 20:41 ` [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop Shawn O. Pearce
2009-05-06 20:48 ` Shawn O. Pearce
2009-05-06 20:50 ` Alex Blewitt
2009-05-06 20:54 ` Shawn O. Pearce
2009-05-06 21:10 ` [PATCH 1/2] Allow monitor/unintersting objects to be null Robin Rosenberg
2009-05-06 21:28 ` Alex Blewitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1241642224-6914-2-git-send-email-alex.blewitt@gmail.com \
--to=alex.blewitt@gmail.com \
--cc=git@vger.kernel.org \
--cc=robin.rosenberg@dewire.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).