Add an optional optimization to FoldingSet to allow ID values to be