diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/WindowCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/WindowCursor.java
index 93e2a02420fc1304d3e7d068c66da60c7dd2eba1..968c92e5ce37a2d489a2170dc81b9c257c070a9e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/WindowCursor.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/WindowCursor.java
@@ -116,10 +116,7 @@ int copy(final PackFile pack, long position, final byte[] dstbuf,
 	 */
 	int inflate(final PackFile pack, long position, final byte[] dstbuf,
 			int dstoff) throws IOException, DataFormatException {
-		if (inf == null)
-			inf = InflaterCache.get();
-		else
-			inf.reset();
+		prepareInflater();
 		for (;;) {
 			pin(pack, position);
 			dstoff = window.inflate(position, dstbuf, dstoff, inf);
@@ -131,10 +128,7 @@ int inflate(final PackFile pack, long position, final byte[] dstbuf,
 
 	void inflateVerify(final PackFile pack, long position)
 			throws IOException, DataFormatException {
-		if (inf == null)
-			inf = InflaterCache.get();
-		else
-			inf.reset();
+		prepareInflater();
 		for (;;) {
 			pin(pack, position);
 			window.inflateVerify(position, inf);
@@ -144,6 +138,13 @@ void inflateVerify(final PackFile pack, long position)
 		}
 	}
 
+	private void prepareInflater() {
+		if (inf == null)
+			inf = InflaterCache.get();
+		else
+			inf.reset();
+	}
+
 	private void pin(final PackFile pack, final long position)
 			throws IOException {
 		final ByteWindow w = window;