Skip to content

Commit 7767ad5

Browse files
committed
try fix performance degradation
1 parent e8a8b2a commit 7767ad5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/input/input_python.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ impl<'py> Input<'py> for Bound<'py, PyAny> {
434434
}
435435

436436
fn lax_dict<'a>(&'a self) -> ValResult<GenericPyMapping<'a, 'py>> {
437-
if self.is_instance_of::<PyDict>() || self.is_instance_of::<PyMapping>() {
438-
Ok(GenericPyMapping::Mapping(self.downcast::<PyMapping>()?))
437+
if let Ok(mapping) = self.downcast::<PyMapping>() {
438+
Ok(GenericPyMapping::Mapping(mapping))
439439
} else {
440440
Err(ValError::new(ErrorTypeDefaults::DictType, self))
441441
}

0 commit comments

Comments
 (0)