mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-25 21:32:28 +00:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user