[Core] Fix another warning and simplify code a little [c2119]