Could this test be before the rehash()?  Would it gain anything if it was except in very marginal cases.