Merge "coverity check: to make code more efficient and robust" into main