Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Fix bug in EETypeOptionalFieldsBuilder
Browse files Browse the repository at this point in the history
Optional field with value 0 should not compare equal to optional field
that is not set.
  • Loading branch information
MichalStrehovsky committed Feb 20, 2016
1 parent fd7395a commit 73337fb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ public override bool Equals(object obj)

for (EETypeOptionalFieldsElement eTag = 0; eTag < EETypeOptionalFieldsElement.Count; eTag++)
{
if (GetFieldValue(eTag, 0) != other.GetFieldValue(eTag, 0))
int index = (int)eTag;
if (_rgFields[index]._fieldPresent != other._rgFields[index]._fieldPresent ||
(_rgFields[index]._fieldPresent && _rgFields[index]._value != other._rgFields[index]._value))
return false;
}

Expand Down

0 comments on commit 73337fb

Please sign in to comment.