Conciseness.

This commit is contained in:
Murilo Pereira 2011-05-09 00:04:03 -03:00
parent 3d421f31d3
commit 539c0ecb00

View File

@ -58,11 +58,9 @@ bool empty(struct stack *stack) {
} }
int length(struct stack *stack) { int length(struct stack *stack) {
int length; int length = 0;
if (empty(stack)) { if (!empty(stack)) {
length = 0;
} else {
for (length = 1; stack->next; stack = stack->next, length++) for (length = 1; stack->next; stack = stack->next, length++)
; ;
} }