[tor-commits] [stem/master] Refactor apply_digest to remove side effects