Search Unity

ComponentType != operator bug?

Discussion in 'Entity Component System' started by RaL, May 4, 2018.

  1. RaL

    RaL

    Joined:
    Nov 29, 2013
    Posts:
    35
    In ComponentType.cs, the != operator is overloaded as follows:
    Code (CSharp):
    1. public static bool operator !=(ComponentType lhs, ComponentType rhs)
    2.         {
    3.             return lhs.TypeIndex != rhs.TypeIndex || lhs.FixedArrayLength != rhs.FixedArrayLength && lhs.AccessModeType == rhs.AccessModeType;
    4.         }
    5.  
    Shouldn't the code actually read like this?
    Code (CSharp):
    1. public static bool operator !=(ComponentType lhs, ComponentType rhs)
    2.         {
    3.             return lhs.TypeIndex != rhs.TypeIndex || lhs.FixedArrayLength != rhs.FixedArrayLength || lhs.AccessModeType != rhs.AccessModeType;
    4.         }
    5.  
     
  2. henrikpAtUnity

    henrikpAtUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    37
    I would say it should.
    Thanks for reporting this. You can expect it fixed in the next version to be released.