             return nil
         }
 
-        let value = dequeueElementOnly()
-        
-        let downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor)
-        if _count < downsizeLimit && downsizeLimit >= _initialCapacity {
-            resizeTo(_storage.count / _resizeFactor)
+        defer {
+            let downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor)
+            if _count < downsizeLimit && downsizeLimit >= _initialCapacity {
+                resizeTo(_storage.count / _resizeFactor)
+            }
         }
-        
-        return value
+
+        return dequeueElementOnly()
     }
     
     /**

        precondition(count > 0)
        
        let index = dequeueIndex
        let value = _storage[index]!
        
        _storage[index] = nil
        
        _count = _count - 1
        
        return value
    }

    /**

                return nil
            }

            defer {
                count -= 1
                i += 1
            }

            if i >= self._storage.count {
                i -= self._storage.count
            }

            return self._storage[i]
        }
    }
}
