Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This seems to tail call correctly with jmp instead of call
+ (NSUInteger)lengthOfListWithHead:(ListNode *)node count:(NSUInteger)count {
if (!node)
return count;
else {
__unsafe_unretained id n = node.next;
return [self lengthOfListWithHead:n count:(count + 1)];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.