Reduce code duplication resulting from the ConstantVector/ConstantDataVector split.

No intended functionality change.