Change int_list in CCL.h to be a vector, fix uses of int_list to match

This commit is contained in:
Tim Wojtulewicz 2019-06-19 15:57:12 -07:00 committed by Jon Siwek
parent e25caa2666
commit a4e2cfa2be
7 changed files with 54 additions and 47 deletions

View file

@ -2,6 +2,8 @@
#include "zeek-config.h"
#include <algorithm>
#include "CCL.h"
#include "RE.h"
#include "DFA.h"
@ -30,14 +32,14 @@ void CCL::Add(int sym)
ptr_compat_int sym_p = ptr_compat_int(sym);
// Check to see if the character is already in the ccl.
for ( int i = 0; i < syms->length(); ++i )
if ( (*syms)[i] == sym_p )
for ( auto sym : *syms )
if ( sym == sym_p )
return;
syms->append(sym_p);
syms->push_back(sym_p);
}
void CCL::Sort()
{
syms->sort(int_list_cmp);
std::sort(syms->begin(), syms->end());
}