minor performance improvement in sampler

@stkem  FYI