Remove code repetition in the doc ID bitmap code.