Fast, low-garbage functions for operating on arrays.