remove useless methods from Pair

This commit is contained in:
dfsek
2026-01-01 22:31:44 -07:00
parent 9357b18964
commit eae5a60cf9
2 changed files with 2 additions and 10 deletions

View File

@@ -37,14 +37,6 @@ public record Pair<L, R>(L left, R right) implements BiFunctor<L, R, Pair<?, ?>>
return pair -> predicate.test(pair.right);
}
public static <L, R> Function<Pair<L, R>, R> unwrapRight() {
return pair -> pair.right;
}
public static <L, R> Function<Pair<L, R>, L> unwrapLeft() {
return pair -> pair.left;
}
@Contract("_, _ -> new")
public static <L1, R1> Pair<L1, R1> of(L1 left, R1 right) {
return new Pair<>(left, right);

View File

@@ -330,7 +330,7 @@ public abstract class AbstractPlatform implements Platform {
.stream()
.filter(Pair.testRight(s -> s.contains(".")))
.map(p -> p.mapRight(s -> s.substring(0, s.lastIndexOf('.')))) // remove major version
.map(Pair.unwrapRight())
.map(Pair::right)
.collect(Collectors.toSet());
@@ -369,7 +369,7 @@ public abstract class AbstractPlatform implements Platform {
.anyMatch(resourcePath::startsWith) && // if any share name
paths
.stream()
.map(Pair.unwrapRight())
.map(Pair::right)
.noneMatch(resourcePath::startsWith)) { // but dont share major version
logger.warn(
"Addon {} has a new major version available. It will not be automatically updated; you will need to " +