Remove use of deprecated .size() method.

This is also a minor speed improvement.

The jQuery documentation has more details: http://api.jquery.com/size/