small optimizations
fix #21221