Remove an unnecessary if

Sora 1 year ago
parent db3e4e8cb1
commit f670a82822

@ -1014,29 +1014,20 @@ impl EditorView {
continue;
}
if let Some(node_pair) = &node_byte_range {
context.insert(StickyNode {
line: node.start_position().row,
visual_line: 0,
byte_range: node_pair.clone(),
indicator: None,
top_first_byte,
cursor_byte,
has_context_end: true,
});
} else {
context.insert(StickyNode {
line: node.start_position().row,
visual_line: 0,
byte_range: node.start_byte()..node.start_byte(),
byte_range: node_byte_range
.as_ref()
.unwrap_or(&(node.start_byte()..node.start_byte()))
.clone(),
indicator: None,
top_first_byte,
cursor_byte,
has_context_end: false,
has_context_end: node_byte_range.is_some(),
});
}
}
}
// context should be filled by now
if context.is_empty() {
return None;

Loading…
Cancel
Save