fixes #4565 - class params search is now significantly faster

Don't ask me why, credit to @abedari