Avoid an O(n**2) operation where O(n) will suffice.  Possibly worth a second or two when running the test suite.
Avoid an O(n**2) operation where O(n) will suffice.  Possibly worth a second or two when running the test suite.

git-svn-id: 554f83ef17aa7291f84efa897c1acfc5d0035373@14433 bcc190cf-cafb-0310-a4f2-bffc1f526a37

svn2github/django,svn2github/django,svn2github/django