small optimization in map extend