OSDN Git Service

The iterator of PathContext class seems to work
authorsdottaka <none@none>
Sun, 18 Aug 2013 16:08:20 +0000 (01:08 +0900)
committersdottaka <none@none>
Sun, 18 Aug 2013 16:08:20 +0000 (01:08 +0900)
Src/DiffWrapper.cpp
Src/DirScan.cpp
Src/FolderCmp.cpp

index 744b1b7..3e4c53a 100644 (file)
@@ -690,9 +690,7 @@ bool CDiffWrapper::RunFileDiff()
 
        bool bRet = true;
        String strFileTemp[3];
-       for (file = 0; file < m_files.GetSize(); file++)
-               strFileTemp[file] = files[file];
-
+       std::copy(m_files.begin(), m_files.end(), strFileTemp);
        
        m_options.SetToDiffUtils();
 
index 6bc9dcb..20b63b3 100644 (file)
@@ -157,8 +157,7 @@ int DirScan_GetItems(const PathContext &paths, const TCHAR * subdir[],
        String subprefix[3];
 
        int nIndex;
-       for (nIndex = 0; nIndex < nDirs; nIndex++)
-               sDir[nIndex] = paths.GetPath(nIndex);
+       std::copy(paths.begin(), paths.end(), sDir);
 
        if (subdir[0][0])
        {
index 64d6b79..b3b810c 100644 (file)
@@ -96,12 +96,7 @@ int FolderCmp::prepAndCompareFiles(CDiffContext * pCtxt, DIFFITEM &di)
 
                // Transformation happens here
                // text used for automatic mode : plugin filter must match it
-               String filteredFilenames = files[0] + _T("|") + files[1];
-               if (nDirs == 3)
-               {
-                       filteredFilenames += _T("|");
-                       filteredFilenames += files[2];
-               }
+               String filteredFilenames = String_join(files.begin(), files.end(), _T("|"));
 
                PackingInfo * infoUnpacker=0;
                PrediffingInfo * infoPrediffer=0;