Is the julia compiler smart enough to treat `x in (y,)` the same as `x == y`?

Sure looks like it!

julia> @code_native debuginfo=:none 1 in (1,)

        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset %rbp, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register %rbp
        cmpq    %rcx, (%rdx)
        sete    %al
        popq    %rbp
        retq
julia> @code_native debuginfo=:none 1 == 1

        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset %rbp, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register %rbp
        cmpq    %rdx, %rcx
        sete    %al
        popq    %rbp
        retq
10 Likes