mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Use linq in extract method
This commit is contained in:
parent
b2c6e9fd25
commit
b3bcffbde0
1 changed files with 3 additions and 16 deletions
|
@ -27,6 +27,7 @@ You should have received a copy of the GNU General Public License
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
|
@ -42,23 +43,9 @@ public static void Extract(string archivePath, string destination, bool retainDi
|
|||
{
|
||||
string entryName = entry.Name;
|
||||
|
||||
if (fileFilter != null)
|
||||
if (fileFilter != null && !fileFilter.Any(x => x.Equals(entryName, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
bool match = false;
|
||||
|
||||
foreach (string file in fileFilter)
|
||||
{
|
||||
if (file.Equals(entryName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!match)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (retainDirectoryStructure)
|
||||
|
|
Loading…
Reference in a new issue