This PR is to optimize code by using computeIfAbsent instead of putIfAbsent, similar to #25054

Comment From: sbrannen

This has been merged into master.

Thanks