diff options
author | Keuin <[email protected]> | 2023-01-13 02:49:57 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-01-13 02:49:57 +0800 |
commit | 5dc6e700cbcbc01833a02a193f660a286b934898 (patch) | |
tree | 72cf4cc3cfae2b3a7fb978bc0c465e329909db3e /src/main/java/com/keuin/kbackupfabric/backup/suggestion | |
parent | ff7d23b5b915f04c2b5f3614701cb56cfc605228 (diff) |
Code cleanup.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/backup/suggestion')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java b/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java index 9c0c1c2..fa38979 100644 --- a/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java +++ b/src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java @@ -47,11 +47,6 @@ public class BackupNameSuggestionProvider { } } -// private static void updateCandidateList(Collection<String> stringCollection) { -// candidateList.clear(); -// candidateList.addAll(stringCollection); -// } - public static SuggestionProvider<ServerCommandSource> getProvider() { // return (context, builder) -> getCompletableFuture(builder); return (context, builder) -> { @@ -61,24 +56,6 @@ public class BackupNameSuggestionProvider { }; } -// private static CompletableFuture<Suggestions> getCompletableFuture(SuggestionsBuilder builder) { -// if (isCacheExpired()) -// updateCandidateList(); -// String remaining = builder.getRemaining().toLowerCase(Locale.ROOT); -// synchronized (syncCache) { -// if (candidateCacheList.isEmpty()) { // If the list is empty then return no suggestions -// return Suggestions.empty(); // No suggestions -// } -// -// for (String string : candidateCacheList) { // Iterate through the supplied list -// if (string.toLowerCase(Locale.ROOT).startsWith(remaining)) { -// builder.suggest(string); // Add every single entry to suggestions list. -// } -// } -// } -// return builder.buildFuture(); // Create the CompletableFuture containing all the suggestions -// } - private static boolean isCacheExpired() { return ((int) System.currentTimeMillis()) - cacheUpdateTime > CACHE_TTL || cacheUpdateTime == 0; } |