Skip to content

Commit c564879

Browse files
committed
Remember match attempts count for triggers that expand variables
1 parent c8fbcd6 commit c564879

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

evaluate.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,16 @@ int iCount = GetTriggerArray ().GetSize (); // how many there are
349349

350350

351351
LONGLONG iOldTimeTaken = 0;
352+
long iOldMatchAttempts = 0;
353+
352354

353355
// remember time taken to execute them
354356

355357
if (trigger_item->regexp)
358+
{
356359
iOldTimeTaken = trigger_item->regexp->iTimeTaken;
360+
iOldMatchAttempts = trigger_item->regexp->m_iMatchAttempts;
361+
}
357362

358363
delete trigger_item->regexp; // get rid of earlier regular expression
359364
trigger_item->regexp = NULL;
@@ -384,7 +389,10 @@ int iCount = GetTriggerArray ().GetSize (); // how many there are
384389

385390
// add back execution time
386391
if (trigger_item->regexp)
392+
{
387393
trigger_item->regexp->iTimeTaken += iOldTimeTaken;
394+
trigger_item->regexp->m_iMatchAttempts += iOldMatchAttempts;
395+
}
388396

389397
} // end of variable substitution
390398

0 commit comments

Comments
 (0)