[tor-commits] [tor/master] Extract duplicate code in geoip and rephist.