Skip to content

Commit

Permalink
chore(commons): remove unused method argument from LongTarjan
Browse files Browse the repository at this point in the history
  • Loading branch information
cmark committed Dec 12, 2024
1 parent 3f89056 commit 184803e
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011-2017 B2i Healthcare, https://b2ihealthcare.com
* Copyright 2011-2024 B2i Healthcare, https://b2ihealthcare.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,11 +23,7 @@
import com.b2international.collections.PrimitiveLists;
import com.b2international.collections.PrimitiveMaps;
import com.b2international.collections.PrimitiveSets;
import com.b2international.collections.longs.LongCollection;
import com.b2international.collections.longs.LongIterator;
import com.b2international.collections.longs.LongKeyIntMap;
import com.b2international.collections.longs.LongList;
import com.b2international.collections.longs.LongSet;
import com.b2international.collections.longs.*;

/**
* Tarjan's algorithm that works with primitive longs for performance.
Expand Down Expand Up @@ -62,7 +58,7 @@ public List<LongSet> run(final LongCollection ids) {
for (final LongIterator itr = ids.iterator(); itr.hasNext(); /* empty */) {
final long currentId = itr.next();
if (indexMap.get(currentId) == -1) {
visit(currentId, ids);
visit(currentId);
}
}

Expand All @@ -73,7 +69,7 @@ public List<LongSet> run(final LongCollection ids) {
return components;
}

private void visit(final long currentId, final LongCollection ids) {
private void visit(final long currentId) {

indexMap.put(currentId, index);
lowLinkMap.put(currentId, index);
Expand All @@ -90,7 +86,7 @@ private void visit(final long currentId, final LongCollection ids) {
}

if (indexMap.get(currentFollowerId) == -1) {
visit(currentFollowerId, ids);
visit(currentFollowerId);
final int newLowLink = Math.min(lowLinkMap.get(currentId), lowLinkMap.get(currentFollowerId));
lowLinkMap.put(currentId, newLowLink);
} else if (idStack.contains(currentFollowerId)) {
Expand Down

0 comments on commit 184803e

Please sign in to comment.