From 5dc6e700cbcbc01833a02a193f660a286b934898 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 13 Jan 2023 02:49:57 +0800 Subject: Code cleanup. --- .../suggestion/BackupNameSuggestionProvider.java | 23 ---------------------- 1 file changed, 23 deletions(-) (limited to 'src/main/java/com/keuin/kbackupfabric/backup/suggestion/BackupNameSuggestionProvider.java') 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 stringCollection) { -// candidateList.clear(); -// candidateList.addAll(stringCollection); -// } - public static SuggestionProvider getProvider() { // return (context, builder) -> getCompletableFuture(builder); return (context, builder) -> { @@ -61,24 +56,6 @@ public class BackupNameSuggestionProvider { }; } -// private static CompletableFuture 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; } -- cgit v1.2.3