I am struggling to understand the following computation from page 59 of Tong's QFT notes
http://www.damtp.cam.ac.uk/user/tong/qft.html
The expression
$$ (-ig)^{2} \int \frac{d^{4}k}{(2\pi)^{4}} \frac{i(2\pi)^{8}}{k^{2} - m^{2} + i\epsilon} [\delta^{4}(p'_{1}-p_{1} + k)\delta^{4}(p'_{2}-p_{2} - k) \\ \hspace{50mm} + \delta^{4}(p'_{2}-p_{1} + k)\delta^{4}(p'_{1}-p_{2} - k)] \tag{3.51} $$
after integrating is said to yield
$$ i(-ig)^{2} \left[\frac{1}{(p_{1}-p'_{1})^{2} - m^{2} + i\epsilon} + \frac{1}{(p_{1}-p'_{2})^{2} - m^{2} + i\epsilon} \right] (2\pi)^{4} \delta^{4}(p_{1} + p_{2} - p'_{1} - p'_{2}) .\tag{p.59}$$
I am fairly certain the "sifting property" of the delta function is being used but I can't seem to convince myself. By using the sifting property I mean applying the following property to the above scenario
$$ f(x) = \int dy \hspace{1mm} f(y) \hspace{1mm} \delta(x-y). $$