Merge pull request #1917 from and-ers/master

array_push optimizations (reverse-merged from commit 157ff017a0776503658b94a8520a2db3ffda9315)