Sean Hoffman
Jan 5, 2023

--

You are correct. Your method is faster and more efficient as it avoids an additional expensive function call. I guess I didn't consider it as I've never been a fan of the "if with a short statement" syntax, but I guess I'd better start getting used to it as there's no question it's more efficient.

Thank you!

--

--

Sean Hoffman
Sean Hoffman

Written by Sean Hoffman

Software Developer (C++, C#, Go, others), Husband, Father. I eat fried potatoes annually on July 14th.

Responses (1)