some changes on assign optimization

some changes on assign optimization, especially on const.