build: use slices.Insert instead of several appends (#681)
I found the code a bit hard to read before, this I believe is more
clear. I was also hoping for an improvement in the benchmarks, but the
improvement was statistically insignificant.
Test Plan: go test