]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/tztrans.cpp
ICU-64252.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / tztrans.cpp
index 32e6ff7ffb90219e2827ff54fa65407cc5d03aa3..3199b78ea833e92c23c487fc19cbc79a745b4b59 100644 (file)
@@ -1,10 +1,14 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
-* Copyright (C) 2007, International Business Machines Corporation and         *
-* others. All Rights Reserved.                                                *
+* Copyright (C) 2007-2012, International Business Machines Corporation and
+* others. All Rights Reserved.
 *******************************************************************************
 */
 
+#include "utypeinfo.h"  // for 'typeid' to work
+
 #include "unicode/utypes.h"
 
 #if !UCONFIG_NO_FORMATTING
@@ -64,16 +68,16 @@ TimeZoneTransition::operator==(const TimeZoneTransition& that) const {
     if (this == &that) {
         return TRUE;
     }
-    if (getDynamicClassID() != that.getDynamicClassID()) {
+    if (typeid(*this) != typeid(that)) {
         return FALSE;
     }
     if (fTime != that.fTime) {
         return FALSE;
     }
-    if (fFrom == NULL && that.fFrom == NULL
-        || fFrom != NULL && that.fFrom != NULL && *fFrom == *(that.fFrom)) {
-        if (fTo == NULL && that.fTo == NULL
-            || fTo != NULL && that.fTo != NULL && *fTo == *(that.fTo)) {
+    if ((fFrom == NULL && that.fFrom == NULL)
+        || (fFrom != NULL && that.fFrom != NULL && *fFrom == *(that.fFrom))) {
+        if ((fTo == NULL && that.fTo == NULL)
+            || (fTo != NULL && that.fTo != NULL && *fTo == *(that.fTo))) {
             return TRUE;
         }
     }