Some little change when generating a bitmask

Did I really use a loop? Instead of some shifting