diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-12-05 16:53:31 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-12-05 16:53:31 +0100 |
| commit | 6ef409e75de2d3cbb0aef2dd19e4f32a5454941d (patch) | |
| tree | 02f45d3c5b4b50a2873844c32e679b8384ee64e4 /src/index | |
| parent | 1265c9aaef3d7d266453002ba45ace3caa8b13a6 (diff) | |
odinfmt: Fix do in for stmt and tenary bug
Diffstat (limited to 'src/index')
| -rw-r--r-- | src/index/memory_index.odin | 12 |
1 files changed, 6 insertions, 6 deletions
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 { |