From 6ef409e75de2d3cbb0aef2dd19e4f32a5454941d Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Sun, 5 Dec 2021 16:53:31 +0100 Subject: odinfmt: Fix do in for stmt and tenary bug --- src/index/memory_index.odin | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/index') diff --git a/src/index/memory_index.odin b/src/index/memory_index.odin index 5cc8831..1e60ec7 100644 --- a/src/index/memory_index.odin +++ b/src/index/memory_index.odin @@ -38,10 +38,6 @@ memory_index_fuzzy_search :: proc(index: ^MemoryIndex, name: string, pkgs: []str top := 20; - if name == "" { - top = 10000 - } - for _, symbol in index.collection.symbols { if !exists_in_scope(symbol.pkg, pkgs) { @@ -59,8 +55,12 @@ memory_index_fuzzy_search :: proc(index: ^MemoryIndex, name: string, pkgs: []str } sort.sort(fuzzy_sort_interface(&symbols)); - - return symbols[:min(top, len(symbols))], true; + strings.clone_to_cstring + if name == "" { + return symbols[:], true; + } else { + return symbols[:min(top, len(symbols))], true; + } } exists_in_scope :: proc(symbol_scope: string, scope: []string) -> bool { -- cgit v1.2.3