3 ms·
You could also just use `String.prototype.padStart()` [1], and you get a nice optimized C++ implementation :D [1]: https://developer.mozilla.org/en-US/docs/Web
by lucacasonato 3y ago
You could also just use `String.prototype.padStart()` [1], and you get a nice optimized C++ implementation :D
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- usrusr 3y agoPass, not a Rust implementation /s
- randomdata 3y agoIs it even AI scale if not performed on the GPU?
- itslennysfault 3y agoNo, you're right. The White House says no more C/C++ it's your civic duty.
- diggan 3y agoWhile funny, worth remembering that .padStart didn't exist when left-pad was first published :)
- JoelEinbinder 3y agoWhile it's not quite C++, here is Chromium's implementation: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/string-pad.tq;drc=f4a00cc248dd2dc8ec8759fb51620d47b5114090;l=15 https://source.chromium.org/chromium/chromium/src/+/main:v8/...
- _aaed 3y agoIt's Torque, which is essentially C++ https://v8.dev/_img/docs/torque/build-process.svg https://v8.dev/_img/docs/torque/build-process.svg