Skip to content

Commit

Permalink
use fastutil in FileContentsTracker
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Nov 9, 2024
1 parent a3caac9 commit 2e10dbb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
package net.prominic.groovyls.util;

import com.cleanroommc.groovyscript.sandbox.FileUtil;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import org.eclipse.lsp4j.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class FileContentsTracker {

private final Map<URI, String> openFiles = new HashMap<>();
private Set<URI> changedFiles = new HashSet<>();
private final Map<URI, String> openFiles = new Object2ObjectOpenHashMap<>();
private Set<URI> changedFiles = new ObjectOpenHashSet<>();

public Set<URI> getOpenURIs() {
return openFiles.keySet();
Expand All @@ -46,7 +46,7 @@ public Set<URI> getChangedURIs() {
}

public void resetChangedFiles() {
changedFiles = new HashSet<>();
changedFiles = new ObjectOpenHashSet<>();
}

public void forceChanged(URI uri) {
Expand Down

0 comments on commit 2e10dbb

Please sign in to comment.