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)
--HG--
branch : stable

Src/DiffWrapper.cpp
Src/DirScan.cpp
Src/FolderCmp.cpp

index 8d48d91..a2519eb 100644 (file)
@@ -691,9 +691,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 df6981a..3ac794f 100644 (file)
@@ -144,8 +144,7 @@ int DirScan_GetItems(const PathContext &paths, const String 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].empty())
        {
index 79addbf..28e7355 100644 (file)
@@ -93,12 +93,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;