减少日频数据读取临时分配

This commit is contained in:
boris
2026-08-26 04:46:08 +08:00
committed by Boris
parent bf2e3af4eb
commit 77622e164c
5 changed files with 23 additions and 9 deletions
+14
View File
@@ -2456,6 +2456,13 @@ impl DataSet {
.unwrap_or_default()
}
pub fn market_snapshot_rows_on(&self, date: NaiveDate) -> &[DailyMarketSnapshot] {
self.market_by_date
.get(&date)
.map(Vec::as_slice)
.unwrap_or(&[])
}
pub fn candidate_snapshots_on(&self, date: NaiveDate) -> Vec<&CandidateEligibility> {
self.candidate_by_date
.get(&date)
@@ -2463,6 +2470,13 @@ impl DataSet {
.unwrap_or_default()
}
pub fn candidate_snapshot_rows_on(&self, date: NaiveDate) -> &[CandidateEligibility] {
self.candidate_by_date
.get(&date)
.map(Vec::as_slice)
.unwrap_or(&[])
}
pub fn bundle_on(&self, date: NaiveDate) -> Result<DailySnapshotBundle, DataSetError> {
let benchmark = self
.benchmark(date)