Fixed #21052 -- Small performance optimization.