simplifications: remove unnecessary optimization * these double checks are not necessary * the compiler will move the early return outside of the called function, basically the functions is partially inlined * however lto/amalgamation needed for the optimization