mirror of
https://github.com/lanyeeee/bilibili-video-downloader.git
synced 2026-09-08 17:16:52 +08:00
perf: 仅在必要时构造下载任务的Future
This commit is contained in:
@@ -170,7 +170,7 @@ impl DownloadTask {
|
|||||||
|
|
||||||
let download_task = async {
|
let download_task = async {
|
||||||
download_task_option
|
download_task_option
|
||||||
.get_or_insert(Box::pin(self.download()))
|
.get_or_insert_with(|| Box::pin(self.download()))
|
||||||
.await;
|
.await;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user