OSDN Git Service

Issue2:コメントの差異を無視する機能がただしく動作しない?
authorsaitaman <none@none>
Fri, 25 Jun 2010 09:31:07 +0000 (18:31 +0900)
committersaitaman <none@none>
Fri, 25 Jun 2010 09:31:07 +0000 (18:31 +0900)
Src/DiffContext.cpp

index dcdf438..89b9a23 100644 (file)
@@ -225,6 +225,9 @@ BOOL CDiffContext::CreateCompareOptions(const DIFFOPTIONS & options)
        else
                return FALSE;
 
+       delete m_pCompareOptions;
+       m_pCompareOptions = NULL;
+
        m_pCompareOptions = GetCompareOptions(m_nCompMethod);
        if (m_pCompareOptions == NULL)
        {
@@ -252,7 +255,11 @@ BOOL CDiffContext::CreateCompareOptions(const DIFFOPTIONS & options)
  */
 CompareOptions * CDiffContext::GetCompareOptions(int compareMethod)
 {
-   // Otherwise we have to create new options
+       //If compare method is same than in previous time, return cached value
+       if (compareMethod == m_nCompMethod && m_pCompareOptions != NULL)
+               return m_pCompareOptions;
+       
+       // Otherwise we have to create new options
        delete m_pCompareOptions;
        m_pCompareOptions = NULL;