Comparison for equality was heavily duplicated.
Merge pull request #85 from Dmitry-Me/equalitycomparison

Comparison for equality was heavily duplicated.