refactor(datatypes): enhance MutableVector methods (#987)

* refactor(datatypes): enhance MutableVector methods

* refactor(datatypes): address code review issues

* refactor(datatypes): address more code review issues

* refactor(datatypes): fix merge conflicts

* refactor(datatypes): address code review issues

* refactor(datatypes): address more code review issues

* refactor(datatypes): update sql delete with the newly introduced method
This commit is contained in:
Eugene Tolbakov
2023-02-17 16:16:23 +08:00
committed by GitHub
parent 2f39a77137
commit 7787cfdd42
23 changed files with 104 additions and 113 deletions
+3 -3
View File
@@ -159,7 +159,7 @@ impl PyVector {
)));
};
// Safety: `pyobj_try_to_typed_val()` has checked the data type.
buf.push_value_ref(val.as_value_ref()).unwrap();
buf.push_value_ref(val.as_value_ref());
}
Ok(PyVector {
@@ -589,14 +589,14 @@ impl PyVector {
// Negative step require special treatment
for i in range.rev().step_by(step.unsigned_abs()) {
// Safety: This mutable vector is created from the vector's data type.
buf.push_value_ref(vector.get_ref(i)).unwrap();
buf.push_value_ref(vector.get_ref(i));
}
let v: PyVector = buf.to_vector().into();
Ok(v.into_pyobject(vm))
} else {
for i in range.step_by(step.unsigned_abs()) {
// Safety: This mutable vector is created from the vector's data type.
buf.push_value_ref(vector.get_ref(i)).unwrap();
buf.push_value_ref(vector.get_ref(i));
}
let v: PyVector = buf.to_vector().into();
Ok(v.into_pyobject(vm))