diff options
author | Ivan Frade <ifrade@google.com> | 2018-12-19 22:25:55 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2018-12-26 09:42:59 -0800 |
commit | 3381bf7e6a2295658739a19d034b73539abadc5c (patch) | |
tree | ded45ef5a5959c911985d856176e456a3ee1048f /org.eclipse.jgit/src | |
parent | 6ea888a036467649fb4d6be9182599bbef879a6d (diff) | |
download | jgit-3381bf7e6a2295658739a19d034b73539abadc5c.tar.gz jgit-3381bf7e6a2295658739a19d034b73539abadc5c.zip |
RefCursor: Remove unnecessary getUpdateIndex method
Now the reference carries its updateIndex, so the cursor doesn't need
to expose it.
Change-Id: Icbfca46f92a13f3d8215ad10b2a166a6f40b0b0f
Signed-off-by: Ivan Frade <ifrade@google.com>
Diffstat (limited to 'org.eclipse.jgit/src')
4 files changed, 2 insertions, 26 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/MergedReftable.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/MergedReftable.java index 17894b1664..c740bf2c37 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/MergedReftable.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/MergedReftable.java @@ -168,7 +168,6 @@ public class MergedReftable extends Reftable { private final PriorityQueue<RefQueueEntry> queue; private RefQueueEntry head; private Ref ref; - private long updateIndex; MergedRefCursor() { queue = new PriorityQueue<>(queueSize(), RefQueueEntry::compare); @@ -206,7 +205,6 @@ public class MergedReftable extends Reftable { } ref = t.rc.getRef(); - updateIndex = t.rc.getUpdateIndex(); boolean include = includeDeletes || !t.rc.wasDeleted(); add(t); skipShadowedRefs(ref.getName()); @@ -242,11 +240,6 @@ public class MergedReftable extends Reftable { } @Override - public long getUpdateIndex() { - return updateIndex; - } - - @Override public void close() { if (head != null) { head.rc.close(); @@ -285,7 +278,7 @@ public class MergedReftable extends Reftable { } long updateIndex() { - return rc.getUpdateIndex(); + return rc.getRef().getUpdateIndex(); } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/RefCursor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/RefCursor.java index 5d4af30a91..9749ffb906 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/RefCursor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/RefCursor.java @@ -69,13 +69,6 @@ public abstract class RefCursor implements AutoCloseable { public abstract Ref getRef(); /** - * Get updateIndex that last modified the current reference. - * - * @return updateIndex that last modified the current reference. - */ - public abstract long getUpdateIndex(); - - /** * Whether the current reference was deleted. * * @return {@code true} if the current reference was deleted. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableCompactor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableCompactor.java index ed73a9efbd..c4e8f69fa4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableCompactor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableCompactor.java @@ -256,7 +256,7 @@ public class ReftableCompactor { private void mergeRefs(MergedReftable mr) throws IOException { try (RefCursor rc = mr.allRefs()) { while (rc.next()) { - writer.writeRef(rc.getRef(), rc.getUpdateIndex()); + writer.writeRef(rc.getRef(), rc.getRef().getUpdateIndex()); } } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java index 8fde7e3b2e..bf3a9aeca0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java @@ -521,11 +521,6 @@ public class ReftableReader extends Reftable { } @Override - public long getUpdateIndex() { - return ref.getUpdateIndex(); - } - - @Override public void close() { // Do nothing. } @@ -691,11 +686,6 @@ public class ReftableReader extends Reftable { } @Override - public long getUpdateIndex() { - return ref.getUpdateIndex(); - } - - @Override public void close() { // Do nothing. } |