34 ms·
You can do the in place variant using generator comprehension and writing the result in place in the original vector. The generator should run ahead of the writ
by gpderetta 11mo ago
You can do the in place variant using generator comprehension and writing the result in place in the original vector. The generator should run ahead of the write and should work fine.
It will also probably be significantly slower than just copying the vector.