remove temporary variable in equal()