diff options
Diffstat (limited to 'crates/ra_ide_db/src')
-rw-r--r-- | crates/ra_ide_db/src/symbol_index.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index 299b47c6a..78c714356 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs | |||
@@ -300,9 +300,6 @@ impl Query { | |||
300 | let mut stream = op.union(); | 300 | let mut stream = op.union(); |
301 | let mut res = Vec::new(); | 301 | let mut res = Vec::new(); |
302 | while let Some((_, indexed_values)) = stream.next() { | 302 | while let Some((_, indexed_values)) = stream.next() { |
303 | if res.len() >= self.limit { | ||
304 | break; | ||
305 | } | ||
306 | for indexed_value in indexed_values { | 303 | for indexed_value in indexed_values { |
307 | let symbol_index = &indices[indexed_value.index]; | 304 | let symbol_index = &indices[indexed_value.index]; |
308 | let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value); | 305 | let (start, end) = SymbolIndex::map_value_to_range(indexed_value.value); |
@@ -314,6 +311,10 @@ impl Query { | |||
314 | if self.exact && symbol.name != self.query { | 311 | if self.exact && symbol.name != self.query { |
315 | continue; | 312 | continue; |
316 | } | 313 | } |
314 | |||
315 | if res.len() >= self.limit { | ||
316 | return res; | ||
317 | } | ||
317 | res.push(symbol.clone()); | 318 | res.push(symbol.clone()); |
318 | } | 319 | } |
319 | } | 320 | } |