[tor-commits] [tor/master] Refactor should-count-towards-thresholds test into new function