From: Shawn O. Pearce Date: Mon, 16 Mar 2009 20:39:35 GMT Subject: Re: [EGIT PATCH 08/10] Drop unused end parameters in hunk parsing code Message-ID: <20090316203935.GT22920@spearce.org> In-Reply-To: <1237234483-3405-9-git-send-email-robin.rosenberg@dewire.com> Robin Rosenberg wrote: > Is this safe, or should they actually be used? Yea, these are safe to remove. At worst we move one line beyond the end marker given to us by the user in Patch.parse() and then abort the parse loop when we find ptr >= end. We should also never exceed the byte[] length; the ParseUtils methods we use do their own array bound checks internally. > .../org/spearce/jgit/patch/CombinedHunkHeader.java | 2 +- > .../src/org/spearce/jgit/patch/HunkHeader.java | 2 +- > .../src/org/spearce/jgit/patch/Patch.java | 8 ++++---- > 3 files changed, 6 insertions(+), 6 deletions(-) -- Shawn.