We can reuse the same `hash` variable to avoid shadowing here.