size is a local copy and also a const.

Nothing is changing the size variable, it should be declared as a const.