comparison rust/hg-cpython/src/revlog.rs @ 51976:3e135e79b7f7

headrevs: replace a boolean match with a if/else I missed that while doing a previous cleanup.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 09 Oct 2024 10:56:51 +0200
parents 609700e5d8df
children f2eab4967bfc
comparison
equal deleted inserted replaced
51975:609700e5d8df 51976:3e135e79b7f7
826 py: Python, 826 py: Python,
827 filtered_revs: &PyObject, 827 filtered_revs: &PyObject,
828 stop_rev: &PyObject, 828 stop_rev: &PyObject,
829 ) -> PyResult<PyObject> { 829 ) -> PyResult<PyObject> {
830 let index = &*self.index(py).borrow(); 830 let index = &*self.index(py).borrow();
831 let stop_rev = match stop_rev.is_none(py) { 831 let stop_rev = if stop_rev.is_none(py) {
832 false => { 832 None
833 let rev = stop_rev.extract::<i32>(py)?; 833 } else {
834 if 0 <= rev && rev < index.len() as BaseRevision { 834 let rev = stop_rev.extract::<i32>(py)?;
835 Some(Revision(rev)) 835 if 0 <= rev && rev < index.len() as BaseRevision {
836 } else { 836 Some(Revision(rev))
837 None 837 } else {
838 } 838 None
839 } 839 }
840 true => None,
841 }; 840 };
842 let from_core = match (filtered_revs.is_none(py), stop_rev.is_none()) { 841 let from_core = match (filtered_revs.is_none(py), stop_rev.is_none()) {
843 (true, true) => index.head_revs_shortcut(), 842 (true, true) => index.head_revs_shortcut(),
844 (true, false) => { 843 (true, false) => {
845 index.head_revs_advanced(&HashSet::new(), stop_rev, false) 844 index.head_revs_advanced(&HashSet::new(), stop_rev, false)