From a735850cfedb52c02ac917f2b6433547155ac1f0 Mon Sep 17 00:00:00 2001 From: Owen Leung Date: Thu, 16 Jan 2025 19:28:05 +0800 Subject: [PATCH] Remove use of get_item. Revise changelog --- newsfragments/4810.added.md | 2 +- src/types/list.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/newsfragments/4810.added.md b/newsfragments/4810.added.md index e89e22e544d..00c7c9e1127 100644 --- a/newsfragments/4810.added.md +++ b/newsfragments/4810.added.md @@ -1 +1 @@ -Optimizes `nth` and `nth_back` for `BoundListIterator` \ No newline at end of file +Optimizes `nth`, `nth_back`, `advance_by` and `advance_back_by` for `BoundListIterator` \ No newline at end of file diff --git a/src/types/list.rs b/src/types/list.rs index 155f5e57be8..51af830d6f5 100644 --- a/src/types/list.rs +++ b/src/types/list.rs @@ -548,7 +548,7 @@ impl<'py> BoundListIterator<'py> { } #[inline] - #[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))] + #[cfg(not(feature = "nightly"))] fn nth( index: &mut Index, length: &mut Length, @@ -619,7 +619,7 @@ impl<'py> BoundListIterator<'py> { } #[inline] - #[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))] + #[cfg(not(feature = "nightly"))] fn nth_back( index: &mut Index, length: &mut Length, @@ -684,7 +684,7 @@ impl<'py> Iterator for BoundListIterator<'py> { } #[inline] - #[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))] + #[cfg(not(feature = "nightly"))] fn nth(&mut self, n: usize) -> Option { self.with_critical_section(|index, length, list| Self::nth(index, length, list, n)) } @@ -863,7 +863,7 @@ impl DoubleEndedIterator for BoundListIterator<'_> { } #[inline] - #[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))] + #[cfg(not(feature = "nightly"))] fn nth_back(&mut self, n: usize) -> Option { self.with_critical_section(|index, length, list| Self::nth_back(index, length, list, n)) }