I am having a doubt on an example on Conway's "Funtions of one Complex Variables". At example 2.9, page 117. At some point, it is stated that, since
$$
a+\cos(\theta)=\dfrac{z^2+2az+1}{2z}
$$
it must imply that
$$
\int\_0^{\pi}\dfrac{d\theta}{a+cos(\theta )}=\dfrac{1}{2}\int\_0^{2\pi}\dfrac{d\theta}{a+cos(\theta)}=-i\int\_{\gamma}\dfrac{dz}{z^2+2az+1}
$$
where $\gamma (t)=e^{it}$, $t\in \left[0,2\pi \right]$.

I could get all that, except for what happens between the last two integrals; I think that there should be a "$2z$" before the $dz$, but when I insert it there the calculations doesn't end up right. Can someone explain me what I'm missing?

Thanks.