Store compiled regular expressions for #170

This commit is contained in:
Michael J. Seiferling
2018-11-12 11:59:07 -06:00
parent 54b624a1cb
commit 7dc61e76ab
3 changed files with 19 additions and 5 deletions
+1 -4
View File
@@ -1,6 +1,5 @@
Imports System.IO
Imports System.Management
Imports System.Text.RegularExpressions
Public Class mgrProcessDetection
@@ -12,7 +11,6 @@ Public Class mgrProcessDetection
Private oDuplicateGames As New ArrayList
Private bDuplicates As Boolean
Private bVerified As Boolean = False
Private oRegEx As Regex
Property FoundProcess As Process
Get
@@ -144,8 +142,7 @@ Public Class mgrProcessDetection
Private Function IsMatch(ByRef oGame As clsGame, ByRef sProcessCheck As String) As Boolean
If oGame.IsRegEx Then
Try
oRegEx = New Regex(oGame.ProcessName)
If oRegEx.IsMatch(sProcessCheck) Then
If oGame.CompiledRegEx.IsMatch(sProcessCheck) Then
Return True
End If
Catch