The != operator just call the == operator
diff --git a/lib/cpp/src/thrift/Thrift.h b/lib/cpp/src/thrift/Thrift.h
index 3a1c5cc..338694b 100644
--- a/lib/cpp/src/thrift/Thrift.h
+++ b/lib/cpp/src/thrift/Thrift.h
@@ -64,11 +64,7 @@
     return (ii_ == rhs.ii_ && n_ == rhs.n_) || (is_end && is_rhs_end);
   }
 
-  bool operator!=(const TEnumIterator& rhs) const {
-    bool is_end = ii_ == n_ || n_ == -1;
-    bool is_rhs_end = rhs.ii_ == rhs.n_ || rhs.n_ == -1;
-    return (ii_ != rhs.ii_ || n_ != rhs.n_) && (!is_end || !is_rhs_end);
-  }
+  bool operator!=(const TEnumIterator& rhs) const { return !(*this == rhs); }
 
   std::pair<int, const char*> operator*() const { return std::make_pair(enums_[ii_], names_[ii_]); }