Skip to content

Commit a735850

Browse files
committed
Remove use of get_item. Revise changelog
1 parent 7751a1c commit a735850

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

newsfragments/4810.added.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Optimizes `nth` and `nth_back` for `BoundListIterator`
1+
Optimizes `nth`, `nth_back`, `advance_by` and `advance_back_by` for `BoundListIterator`

src/types/list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ impl<'py> BoundListIterator<'py> {
548548
}
549549

550550
#[inline]
551-
#[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))]
551+
#[cfg(not(feature = "nightly"))]
552552
fn nth(
553553
index: &mut Index,
554554
length: &mut Length,
@@ -619,7 +619,7 @@ impl<'py> BoundListIterator<'py> {
619619
}
620620

621621
#[inline]
622-
#[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))]
622+
#[cfg(not(feature = "nightly"))]
623623
fn nth_back(
624624
index: &mut Index,
625625
length: &mut Length,
@@ -684,7 +684,7 @@ impl<'py> Iterator for BoundListIterator<'py> {
684684
}
685685

686686
#[inline]
687-
#[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))]
687+
#[cfg(not(feature = "nightly"))]
688688
fn nth(&mut self, n: usize) -> Option<Self::Item> {
689689
self.with_critical_section(|index, length, list| Self::nth(index, length, list, n))
690690
}
@@ -863,7 +863,7 @@ impl DoubleEndedIterator for BoundListIterator<'_> {
863863
}
864864

865865
#[inline]
866-
#[cfg(all(not(Py_LIMITED_API), not(feature = "nightly")))]
866+
#[cfg(not(feature = "nightly"))]
867867
fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
868868
self.with_critical_section(|index, length, list| Self::nth_back(index, length, list, n))
869869
}

0 commit comments

Comments
 (0)