you can do better as you create 2 allocations of data. You should preallocate and then you would avoid the if on one ilne that breaks coverage.