The problem comes with this follow up:

If this function is called many times, how would you optimize it?

I thought at it, but I cannot answer this question. Any hints?

FWIW, here's my solution (Python):

```
class Solution(object):
def reverseBits(self, n):
m = 0
for i in xrange(32):
m = (m << 1) | (n & 1)
n >>= 1
return m
```