Skip to content

Commit 58c8dd6

Browse files
chore: add docs for PrincipleVariation
bench: 2517656
1 parent 65b9c6d commit 58c8dd6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

engine/src/principle_variation.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,27 @@ impl PrincipleVariation {
3737
Ok(push_result?)
3838
}
3939

40+
/// Extend the current [PrincipleVariation] with the given move and another principle variation.
41+
///
42+
/// This will clear the current PV and append the given move and [PrincipleVariation].
43+
///
44+
/// # Arguments:
45+
///
46+
/// - m: The new move to add to the principle variation.
47+
/// - pv: The principle variation to append to the current variation.
4048
#[inline(always)]
4149
pub(crate) fn extend(&mut self, m: Move, pv: &Self) -> Result<()> {
4250
self.clear();
4351
self.push(m)?;
4452
Ok(self.data.try_extend_from_slice(pv.data.as_slice())?)
4553
}
4654

55+
/// Clear the principle variation.
4756
pub(crate) fn clear(&mut self) {
4857
self.data.clear();
4958
}
5059

60+
/// Returns an iterator to the underlying data of the [PrincipleVariation].
5161
pub(crate) fn iter(&self) -> impl Iterator<Item = &Move> {
5262
self.data.iter()
5363
}

0 commit comments

Comments
 (0)