Avoid unnecessary map lookup/insertion.