79
L4ng3
6y

Found this in a API from a big company. NDA prevent me from telling the name.
if(index < 1024 && index > 1024)

Comments
  • 12
    #Obfuscation
  • 6
    Looks like someone wants it to work only when index == 1024
  • 5
    @azous well, it's always false you see it never works
    Replace with if (false)
  • 4
    Simple program and result...
  • 0
    @pacohojaverde any idea why ?
  • 2
    @ilbreebchi because it’s a logical and, the index isn’t < 1024 **and** > 1024 at the same time, it’s a logical contradiction. So it’s always false.

    Resharper would probably flag it as such.
  • 1
    @Brolls oh wait..

    I guess I had a long day ^_^'
  • 0
    this would have made sense in case of ORing floats ..
  • 2
    @VTCoder oh yeah, I wasn't thinking properly.
    Thank you for opening my eyes
  • 1
    Well, I've seen someone trying to prank his fellow devs by using the same condition just with <= and >= to obfuscate a simple ==.
    Embarassing how long it took me to realize.. Still facepalming when I remember that
  • 0
    How can index be larger yet at the same time smaller than 1024?
  • 1
    @pacohojaverde C#?

    P.S. - if it is, I could tell from its resemblance to Java syntax but its application of UpperCamelCase to everything.

    Edit: just noticed the “*.cs” in the console to the right. 😂
Add Comment