Enum.sample/2: dedup code in reducer branches