Skip to content

Commit 004b7b8

Browse files
committed
Remove with_gil for calling extend() in new()
1 parent 0173063 commit 004b7b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/circuit/src/circuit_data.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl CircuitData {
171171
}
172172
if let Some(data) = data {
173173
self_.reserve(reserve);
174-
Python::with_gil(|py| -> PyResult<()> { self_.extend(py, data) })?;
174+
self_.extend(data)?;
175175
}
176176
Ok(self_)
177177
}
@@ -902,7 +902,8 @@ impl CircuitData {
902902
Ok(())
903903
}
904904

905-
pub fn extend(&mut self, py: Python<'_>, itr: &Bound<PyAny>) -> PyResult<()> {
905+
pub fn extend(&mut self, itr: &Bound<PyAny>) -> PyResult<()> {
906+
let py = itr.py();
906907
if let Ok(other) = itr.downcast::<CircuitData>() {
907908
let other = other.borrow();
908909
// Fast path to avoid unnecessary construction of CircuitInstruction instances.

0 commit comments

Comments
 (0)