Skip to content

Commit 2241b43

Browse files
committed
Change redundant check that will be covered below anyways
1 parent f0de74c commit 2241b43

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

  • crates/static-analysis-kernel/src/analysis/languages/python

crates/static-analysis-kernel/src/analysis/languages/python/imports.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,9 @@ fn parse_import_statement<'tree, 'text: 'tree>(
232232
// We loop so that if creating the `Import` fails, we can try any subsequent imports within
233233
// this node (e.g. in a comma-separated list) to avoid prematurely yielding `None` on the iterator.
234234
while idx < node.named_child_count() {
235-
let field_name = node.field_name_for_named_child(idx as u32);
236235
let name_node = node.named_child(idx).expect("should be in-bounds");
237236
idx += 1;
238237

239-
if field_name != Some("name") {
240-
continue;
241-
}
242238
if let Some(parsed) = parse_field_child_node(source_code, name_node) {
243239
if let Ok(import) = Import::try_new(parsed.full_text, parsed.alias, None, false) {
244240
return Some(import);

0 commit comments

Comments
 (0)