So, I really don't think this is even worth mentioning. Much more important is to check whether the number of tile IDs matches with your expectations and report an error if it is not the case. Currently you would get an out of bounds exception in the code below.