3 ms·
Yeah, it simplifies later code, and is safer in the face of future changes. Or put another way, it tightens the API/contract of that chunk of code to always re
by lokar 7mo ago
Yeah, it simplifies later code, and is safer in the face of future changes.
Or put another way, it tightens the API/contract of that chunk of code to always return a valid string.
- lioeters 7mo agoThat makes sense, with that "guard" at the top, the rest of the function can return the pointer anywhere. And I imagine the compiler will ensure the empty string literal is created only once. Good to know!