Refactor addEntry in primitive set.

I will need to change this function and don't want to make sure I keep both copy-pasted versions in sync.

PiperOrigin-RevId: 465311635
Change-Id: I765107ec4cbec3249a26e38c16a706f7ef38331b
1 file changed