Skip to content
Snippets Groups Projects
Commit 76b98230 authored by Shawn Pearce's avatar Shawn Pearce
Browse files

Use keep(1) instead of add() when skipping an entry

Doing a keep call with a length of 1 will copy the current entry just
like the previous add was doing, but it avoids doing any validation
on the entry.  This is sane because the entry can be assumed to be
already valid, since its originating from the destination index.

Change-Id: I250d902fc98580444af1ba4b8fedceb654541451
Originally: http://thread.gmane.org/gmane.comp.version-control.git/128214/focus=128213


Signed-off-by: default avatarShawn O. Pearce <spearce@spearce.org>
parent 29b8fa84
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright (C) 2008, Google Inc. * Copyright (C) 2008-2009, Google Inc.
* Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@dewire.com> * Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* and other copyright owners as documented in the project's IP log. * and other copyright owners as documented in the project's IP log.
...@@ -119,7 +119,7 @@ public void skip() throws CorruptObjectException { ...@@ -119,7 +119,7 @@ public void skip() throws CorruptObjectException {
if (currentSubtree != null) if (currentSubtree != null)
builder.keep(ptr, currentSubtree.getEntrySpan()); builder.keep(ptr, currentSubtree.getEntrySpan());
else else
builder.add(currentEntry); builder.keep(ptr, 1);
next(1); next(1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment