Minor optimization + const'ify

2 jobs for master
Status Job ID Name Coverage
  Build
canceled #70489
build_clazy_clang_tidy

canceled #70488
linux kf5-qt5 qt5.12