4 ms·
frustration += 1 Should be: frustration++
by ape4 12y ago
frustration += 1
Should be:
frustration++
- ritchiea 12y agoNot in ruby, which is the language he's writing the pseudocode in.
- EliRivers 12y agoIn the C family, it should be ++frustration, for speed :p
- danellis 12y agoFor an integer, if the pre-increment value isn't used, GCC at least will generate the same code, even with optimization turned off: int pre(int a) { int post(int a) { ++a; a++; return a; return a; } } pre: post: .LFB0: .LFB1: .cfi_startproc .cfi_startproc pushq %rbp pushq %rbp .cfi_def_cfa_offset 16 .cfi_def_cfa_offset 16 .cfi_offset 6, -16 .cfi_offset 6, -16 movq %rsp, %rbp movq %rsp, %rbp .cfi_def_cfa_register 6 .cfi_def_cfa_register 6 movl %edi, -4(%rbp) movl %edi, -4(%rbp) addl $1, -4(%rbp) addl $1, -4(%rbp) movl -4(%rbp), %eax movl -4(%rbp), %eax popq %rbp popq %rbp .cfi_def_cfa 7, 8 .cfi_def_cfa 7, 8 ret ret
- cmdrfred 12y agoCorrecting the syntax of pseudocode, you must be fun at parties.