I approve. Although it's not the same thing, it's faster and gets the job done.
Caching the .type of r and other properties of other particles also helps a bit.