[#589] optimized a few functions by directly manipulating `glArray`

And I did not break anything this time :)