Remove in empty array optimization
Merge pull request #3322 from xixixao/issue1099

Fix #1099, remove in empty array optimization