Wouldn't a simple `for` loop be more performant. And more "elegant"?