mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Revert a breaking change to fuzzy item/block lookup.
This commit is contained in:
parent
5ed9239e14
commit
b0a52a4cf7
@ -289,7 +289,7 @@ public final class StringUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int minDist = Integer.MAX_VALUE;
|
int minDist = -1;
|
||||||
|
|
||||||
for (Map.Entry<String, T> entry : lookup.entrySet()) {
|
for (Map.Entry<String, T> entry : lookup.entrySet()) {
|
||||||
final String key = entry.getKey();
|
final String key = entry.getKey();
|
||||||
@ -299,16 +299,12 @@ public final class StringUtil {
|
|||||||
|
|
||||||
int dist = getLevenshteinDistance(key, testName);
|
int dist = getLevenshteinDistance(key, testName);
|
||||||
|
|
||||||
if (dist >= minDist) {
|
if ((dist < minDist || minDist == -1) && dist < 2) {
|
||||||
minDist = dist;
|
minDist = dist;
|
||||||
type = entry.getValue();
|
type = entry.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minDist > 1) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user