If I sell stock, rebuy it and sell it once again in the same year, am I charged twice the capital gains tax?

If I sell stock, rebuy it and sell it once again in the same year, am I charged twice the capital gains tax?

This of course assuming I profit from both sales.