gpui: Pre-allocate paths in open file dialog (#32106)
Pre-allocates the required memory for storing paths returned by open file dialog on windows Release Notes: - N/A
This commit is contained in:
parent
b7c2d4876c
commit
9775747ba9
1 changed files with 1 additions and 1 deletions
|
@ -780,7 +780,7 @@ fn file_open_dialog(options: PathPromptOptions) -> Result<Option<Vec<PathBuf>>>
|
|||
return Ok(None);
|
||||
}
|
||||
|
||||
let mut paths = Vec::new();
|
||||
let mut paths = Vec::with_capacity(file_count as usize);
|
||||
for i in 0..file_count {
|
||||
let item = unsafe { results.GetItemAt(i)? };
|
||||
let path = unsafe { item.GetDisplayName(SIGDN_FILESYSPATH)?.to_string()? };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue