Revert "[System.Core] Don't auto increment when trimming hashset. Fixes #18687"

This reverts commit 824c987fe8f16beec01246fd698400918d1d6127.