Skip to content

Commit

Permalink
[FEATURE] In pattern_tree: added wrapper for text patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Feb 8, 2024
1 parent dd6ac87 commit e86b361
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions utils/pattern_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ namespace pattern_tree {

static bool addPattern(Node* rootN, const char* _name, const BYTE* pattern, size_t pattern_size)
{
if (!rootN || !pattern) return false;

if (!rootN || !pattern || !pattern_size) {
return false;
}
Node* next = rootN;
for (size_t i = 0; i < pattern_size; i++) {
next = next->addNext(pattern[i]);
Expand All @@ -127,6 +128,11 @@ namespace pattern_tree {
return true;
}

static bool addTextPattern(Node* rootN, const char* pattern1)
{
return Node::addPattern(rootN, pattern1, (const BYTE*)pattern1, strlen(pattern1));
}

//---

Node()
Expand Down

0 comments on commit e86b361

Please sign in to comment.