-
Notifications
You must be signed in to change notification settings - Fork 88
Description
empty_record:
Lines 516 to 519 in 8f1cdd7
| pub fn empty_record(&self) -> crate::bcf::Record { | |
| crate::bcf::Record::new(Rc::new(self.clone())) | |
| } | |
| } |
does a bcf_hdr_dup on the header:
Lines 521 to 526 in 8f1cdd7
| impl Clone for HeaderView { | |
| fn clone(&self) -> Self { | |
| HeaderView { | |
| inner: unsafe { htslib::bcf_hdr_dup(self.inner) }, | |
| } | |
| } |
Is this necessary? I think we can just clone the Rc instead?
I ask because this is showing up on a profiling run in a real application for me.
The empty_record is called for every next on a reader:
Lines 802 to 808 in 8f1cdd7
| fn next(&mut self) -> Option<Result<record::Record>> { | |
| let mut record = self.reader.empty_record(); | |
| match self.reader.read(&mut record) { | |
| Some(Err(e)) => Some(Err(e)), | |
| Some(Ok(_)) => Some(Ok(record)), | |
| None => None, | |
| } |
Metadata
Metadata
Assignees
Labels
No labels