diff --git a/src/Server.zig b/src/Server.zig index 81862e1bd..edaa7f518 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -1644,13 +1644,12 @@ fn workspaceSymbolHandler(server: *Server, arena: std.mem.Allocator, request: ty doc_loop: for (server.document_store.trigram_stores.keys(), server.document_store.trigram_stores.values()) |uri, trigram_store| { const handle = server.document_store.getOrLoadHandle(uri) orelse continue; - if (trigram_store.filter == null) continue; const tree = handle.tree; const doc_scope = try handle.getDocumentScope(); for (trigrams.items) |trigram| { - if (!trigram_store.filter.?.contain(@bitCast(trigram))) continue :doc_loop; + if (!trigram_store.filter.contain(@bitCast(trigram))) continue :doc_loop; } candidate_decls_buffer.clearRetainingCapacity(); diff --git a/src/TrigramStore.zig b/src/TrigramStore.zig index 5e4450488..8b3f616bd 100644 --- a/src/TrigramStore.zig +++ b/src/TrigramStore.zig @@ -11,7 +11,7 @@ const CompactingMultiList = @import("compacting_multi_list.zig").CompactingMulti const TrigramStore = @This(); /// Fast lookup with false positives. -filter: ?fastfilter.BinaryFuse8, +filter: fastfilter.BinaryFuse8, /// Map index is a slice in decls. lookup: std.AutoArrayHashMapUnmanaged(Trigram, void), decls: CompactingMultiList(Declaration.Index).Compacted, @@ -114,7 +114,7 @@ pub fn reset(store: *TrigramStore, allocator: std.mem.Allocator) void { } pub fn deinit(store: *TrigramStore, allocator: std.mem.Allocator) void { - if (store.filter) |filter| filter.deinit(allocator); + store.filter.deinit(allocator); store.lookup.deinit(allocator); store.decls.deinit(allocator); store.* = undefined;