Browse Source

修复:文件列表为空转换列表报错

yuzhengyang 9 years ago
parent
commit
3aa507a863
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Fork.Net/Y.Utils/FileUtils/FileTool.cs

+ 3 - 3
Fork.Net/Y.Utils/FileUtils/FileTool.cs

@@ -36,7 +36,7 @@ namespace Y.Utils.FileUtils
             {
                 foreach (var p in pattern)
                 {
-                    List<string> temp = GetAllFile(path, p).ToList();
+                    List<string> temp = GetAllFile(path, p);
                     if (!ListTool.IsNullOrEmpty(temp)) result.AddRange(temp);
                 }
             }
@@ -53,12 +53,12 @@ namespace Y.Utils.FileUtils
                     {
                         foreach (var pattern in patterns)
                         {
-                            List<string> temp = GetAllFile(path, pattern).ToList();
+                            List<string> temp = GetAllFile(path, pattern);
                             if (!ListTool.IsNullOrEmpty(temp)) result.AddRange(temp);
                         }
                     }else
                     {
-                        List<string> temp = GetAllFile(path).ToList();
+                        List<string> temp = GetAllFile(path);
                         if (!ListTool.IsNullOrEmpty(temp)) result.AddRange(temp);
                     }
                 }