Only calculate bit count once