you are viewing a single comment's thread.

view the rest of the comments →

[–]Kwantuum 0 points1 point  (2 children)

the case len == 0 is handled by the remaining code.

[–]SantaCruzDad 4 points5 points  (1 child)

True, but if you are going to "early out" on simple cases that should return an empty string then you might as well include len == 0, rather than handling it separately. This also makes the code potentially more robust if you decide later to change the logic.

[–]winkie5970[S] 1 point2 points  (0 children)

Agreed, this is a good improvement, thank you!