editor: Shrink DisplayMapSnapshot from 824 to 256 bytes (#39568)
We have unnecessary clones for the fields here as most of the snapshots contain the others hierarchically. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -248,7 +248,7 @@ impl ChannelView {
|
||||
.editor
|
||||
.update(cx, |editor, cx| editor.snapshot(window, cx));
|
||||
|
||||
if let Some(outline) = snapshot.buffer_snapshot.outline(None)
|
||||
if let Some(outline) = snapshot.buffer_snapshot().outline(None)
|
||||
&& let Some(item) = outline
|
||||
.items
|
||||
.iter()
|
||||
@@ -305,7 +305,7 @@ impl ChannelView {
|
||||
|
||||
let mut closest_heading = None;
|
||||
|
||||
if let Some(outline) = snapshot.buffer_snapshot.outline(None) {
|
||||
if let Some(outline) = snapshot.buffer_snapshot().outline(None) {
|
||||
for item in outline.items {
|
||||
if item.range.start.to_display_point(&snapshot) > position {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user