rem: CollisionPair* curPtr = &(coll_pairs.GetElementAt(i)); distVec = curPtr->contact - v; Real dist = distVec.length(); if (dist < minDist) { minDist = dist; minPtr  = curPtr; }
add: CollisionPair* curPtr = &icp->second; distVec = curPtr->contact - v; Real dist = distVec.squaredLength(); if (dist < minDist) { minDist = dist; minPtr  = curPtr; }
context:       int GetClosestCollision(const Vector3& v, CollisionPair **& crPtr)      {         int num = coll_pairs.Size();         if (0 == num)         {            crPtr = 0;            return 0;         }         int i;         Vector3 distVec;         CollisionPair* minPtr = &(coll_pairs.GetElementAt(0));         float minDist = Vector3(minPtr->contact - v).length();         for (i = 1; i < num; i++)         {            CollisionPair* curPtr = &(coll_pairs.GetElementAt(i));            distVec = curPtr->contact - v;            Real dist = distVec.length();            if (dist < minDist)            {               minDist = dist;               minPtr  = curPtr;            }         }         report_array[0] = minPtr;         crPtr = report_array;         return 1;      }