prisma-engines
e245ca09 - qe: remove unneccessary `clone()` in `ReadQuery::satisfy_dependency` (#4643)

Commit
2 years ago
qe: remove unneccessary `clone()` in `ReadQuery::satisfy_dependency` (#4643) `clone()` was there to work around not being able to directly move values out of a mutable reference. However, moving out of a mutable reference is possible as long as you leave something behind instead. `std::mem::take` leaves `Default::default()` behind, which, unlike reallocating and copying a vector, can be easily optimized out, and even if it isn't, constructing a default `FieldSelection` is just a few `mov` instructions anyway. Before: https://rust.godbolt.org/z/dzPjPEqeP After: https://rust.godbolt.org/z/o5PhYqhTW
Author
Parents
Loading