A computationally efficient approach for calculating galaxytwo-point correlations