rust-changelog: removed now useless early conditional for NULL_REVISION
Now that the underlying `RevlogEntry` returned for `NULL_REVISION` is
viable, it has become pointless to check NULL_REVISION several times,
even for performance: the check will be far more frequent than the benefit
of bailing earlier in the rare case where the requested revision is
`NULL_REVISION`.
This case is covered explicitly by the first assertion of
`test_data_from_rev_null`.
--- a/rust/hg-core/src/revlog/changelog.rs Thu Jul 06 11:53:40 2023 +0200
+++ b/rust/hg-core/src/revlog/changelog.rs Thu Jul 06 11:58:24 2023 +0200
@@ -1,6 +1,6 @@
use crate::errors::HgError;
+use crate::revlog::Revision;
use crate::revlog::{Node, NodePrefix};
-use crate::revlog::{Revision, NULL_REVISION};
use crate::revlog::{Revlog, RevlogEntry, RevlogError};
use crate::utils::hg_path::HgPath;
use crate::vfs::Vfs;
@@ -51,9 +51,6 @@
&self,
rev: Revision,
) -> Result<ChangelogRevisionData, RevlogError> {
- if rev == NULL_REVISION {
- return Ok(ChangelogRevisionData::null());
- }
self.entry_for_rev(rev)?.data()
}