mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
remove useless methods from Pair
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 " +
|
||||
|
||||
Reference in New Issue
Block a user