what is the use of "<<=" operator?
In simpler terms mask &lt;&lt;= 1 is shorthand for mask = mask &lt;&lt; 1

In general 

variable operator= operand


is the augmented assignment operator which means 

variable = variable operator operand