Re:Open-source online SVG path editor
by jansan on Friday February 18, 2022 @07:40AM
(#30385004)
You can make this even 4 chars shorter by using relative move-to commands (small 'm'):
[ Parent
| on HN ]
Re:Open-source online SVG path editor
by chrismorgan on Friday February 18, 2022 @07:50AM
(#30385087)
Hmm, I contemplated that at first but decided against it for some reason that’s not quite clear to me now, but I think I mispredicted its verbosity in both literal and compressed form.
For compression purposes, mine is going to be kinda like this:
‹M21 ›5‹H3v1h18›‹M21 ›11‹H3v1h18›‹M21 ›17‹H3v1h18›
Yours will probably treat only one block, slightly bigger, as a repeated thing: M21‹ 5H3v1h18›m0‹ 5H3v1h18›m0‹ 5H3v1h18›
I expect that would compress 2–5 bytes smaller.I’d lowercase that M, too; it doesn’t need to be uppercase, so it might as well be lowercase like the others!
A couple fewer bits or bytes is not going to make a noticeable performance difference.
Re:Open-source online SVG path editor
by chrismorgan on Friday February 18, 2022 @09:35PM
(#30393923)
So? Golfing things like this is mostly about fun, with a side benefit of being aware of things that, on a (much) larger scale, do start to matter.