git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [EGIT PATCH] Skip unnecessary test in ObjectChecker
@ 2009-04-26 14:36 Robin Rosenberg
  2009-04-27 21:30 ` Shawn O. Pearce
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Rosenberg @ 2009-04-26 14:36 UTC (permalink / raw)
  To: spearce; +Cc: git, Robin Rosenberg

The check for duplicate names unnecessarily checks for end of buffer.
Previous tests took care of that.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../src/org/spearce/jgit/lib/ObjectChecker.java    |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectChecker.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectChecker.java
index 75e3c77..5a3da39 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectChecker.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectChecker.java
@@ -254,14 +254,10 @@ private static boolean duplicateName(final byte[] raw,
 
 			final int nextNamePos = nextPtr;
 			for (;;) {
-				if (nextPtr == sz)
-					return false;
 				final byte c = raw[nextPtr++];
 				if (c == 0)
 					break;
 			}
-			if (nextNamePos + 1 == nextPtr)
-				return false;
 
 			final int cmp = pathCompare(raw, thisNamePos, thisNameEnd,
 					FileMode.TREE.getBits(), nextNamePos, nextPtr - 1, nextMode);
-- 
1.6.3.rc2.1.g4f9e8.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-27 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-26 14:36 [EGIT PATCH] Skip unnecessary test in ObjectChecker Robin Rosenberg
2009-04-27 21:30 ` Shawn O. Pearce

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).