diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-05-03 00:23:01 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-05-03 12:43:59 +0200 |
commit | 8f2b4c8a6e3d53c62804bc7f874231976618364b (patch) | |
tree | 66a02bae954b3df33e767aa7171005c6e7c1ee05 /org.eclipse.jgit/src/org/eclipse | |
parent | 2e5bd2a362cbc74ebbdea76c47457e8f285a2118 (diff) | |
download | jgit-8f2b4c8a6e3d53c62804bc7f874231976618364b.tar.gz jgit-8f2b4c8a6e3d53c62804bc7f874231976618364b.zip |
Use integer depth in PackWriter's DepthAwareVisitationPolicy
- ObjectWalk.getTreeDepth() returns int hence there is no need to use
long depths in the lowestDepthVisited map.
- Also fix boxing warnings introduced in 0a15cb3a.
Change-Id: I6d73b6f41d5d20975d02f376c8588e411eaff0ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java index 95d8f17a7b..b6e6a6c497 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java @@ -881,7 +881,7 @@ public class PackWriter implements AutoCloseable { */ private class DepthAwareVisitationPolicy implements ObjectWalk.VisitationPolicy { - private final Map<ObjectId, Long> lowestDepthVisited = new HashMap<>(); + private final Map<ObjectId, Integer> lowestDepthVisited = new HashMap<>(); private final ObjectWalk walk; @@ -891,16 +891,16 @@ public class PackWriter implements AutoCloseable { @Override public boolean shouldVisit(RevObject o) { - Long lastDepth = lowestDepthVisited.get(o); + Integer lastDepth = lowestDepthVisited.get(o); if (lastDepth == null) { return true; } - return walk.getTreeDepth() < lastDepth; + return walk.getTreeDepth() < lastDepth.intValue(); } @Override public void visited(RevObject o) { - lowestDepthVisited.put(o, (long) walk.getTreeDepth()); + lowestDepthVisited.put(o, Integer.valueOf(walk.getTreeDepth())); } } |