Index: /trunk/include/iprt/cpp/list.h
===================================================================
--- /trunk/include/iprt/cpp/list.h	(revision 55946)
+++ /trunk/include/iprt/cpp/list.h	(revision 55947)
@@ -458,23 +458,24 @@
     {
         /* Prevent self assignment */
-        if (RT_UNLIKELY(this == &other))
-            return *this;
-
-        other.m_guard.enterRead();
-        m_guard.enterWrite();
-
-        /* Delete all items. */
-        RTCListHelper<T, ITYPE>::eraseRange(m_pArray, 0, m_cElements);
-
-        /* Need we to realloc memory. */
-        if (other.m_cElements != m_cCapacity)
-            resizeArrayNoErase(other.m_cElements);
-        m_cElements = other.m_cElements;
-
-        /* Copy new items. */
-        RTCListHelper<T, ITYPE>::copyTo(m_pArray, other.m_pArray, 0, other.m_cElements);
-
-        m_guard.leaveWrite();
-        other.m_guard.leaveRead();
+        if (RT_LIKELY(this != &other))
+        {
+
+            other.m_guard.enterRead();
+            m_guard.enterWrite();
+
+            /* Delete all items. */
+            RTCListHelper<T, ITYPE>::eraseRange(m_pArray, 0, m_cElements);
+
+            /* Need we to realloc memory. */
+            if (other.m_cElements != m_cCapacity)
+                resizeArrayNoErase(other.m_cElements);
+            m_cElements = other.m_cElements;
+
+            /* Copy new items. */
+            RTCListHelper<T, ITYPE>::copyTo(m_pArray, other.m_pArray, 0, other.m_cElements);
+
+            m_guard.leaveWrite();
+            other.m_guard.leaveRead();
+        }
         return *this;
     }
@@ -635,12 +636,12 @@
     {
         m_guard.enterRead();
-        if (RT_UNLIKELY(i >= m_cElements))
-        {
+        if (RT_LIKELY(i < m_cElements))
+        {
+            T res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
             m_guard.leaveRead();
-            return T();
-        }
-        T res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
-        m_guard.leaveRead();
-        return res;
+            return res;
+        }
+        m_guard.leaveRead();
+        return T();
     }
 
@@ -655,12 +656,12 @@
     {
         m_guard.enterRead();
-        if (RT_UNLIKELY(i >= m_cElements))
-        {
+        if (RT_LIKELY(i < m_cElements))
+        {
+            T res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
             m_guard.leaveRead();
-            return defaultVal;
-        }
-        T res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
-        m_guard.leaveRead();
-        return res;
+            return res;
+        }
+        m_guard.leaveRead();
+        return defaultVal;
     }
 
