Added /mask

You're calling the `GetMask()` for each loop repetition. Move it in front of the loop to enhance performance.