mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
rename hashedNodeVec to NodeVec
Shorten the name length by dropping the leading "hashed". Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
3f6ebfd218
commit
53d00b4d2b
@ -992,7 +992,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class hashedNodeVec {
|
||||
class NodeVec {
|
||||
public:
|
||||
typedef ImportantNode ** iterator;
|
||||
iterator begin() { return nodes; }
|
||||
@ -1002,7 +1002,7 @@ public:
|
||||
unsigned long len;
|
||||
ImportantNode **nodes;
|
||||
|
||||
hashedNodeVec(NodeSet *n)
|
||||
NodeVec(NodeSet *n)
|
||||
{
|
||||
hash = hash_NodeSet(n);
|
||||
len = n->size();
|
||||
@ -1014,7 +1014,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
hashedNodeVec(NodeSet *n, unsigned long h): hash(h)
|
||||
NodeVec(NodeSet *n, unsigned long h): hash(h)
|
||||
{
|
||||
len = n->size();
|
||||
nodes = new ImportantNode *[n->size()];
|
||||
@ -1024,14 +1024,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
~hashedNodeVec()
|
||||
~NodeVec()
|
||||
{
|
||||
delete [] nodes;
|
||||
}
|
||||
|
||||
unsigned long size()const { return len; }
|
||||
|
||||
bool operator<(hashedNodeVec const &rhs)const
|
||||
bool operator<(NodeVec const &rhs)const
|
||||
{
|
||||
if (hash == rhs.hash) {
|
||||
if (len == rhs.size()) {
|
||||
@ -1095,7 +1095,7 @@ public:
|
||||
};
|
||||
|
||||
struct deref_less_than {
|
||||
bool operator()(hashedNodeVec * const &lhs, hashedNodeVec * const &rhs)const
|
||||
bool operator()(NodeVec * const &lhs, NodeVec * const &rhs)const
|
||||
{
|
||||
return *lhs < *rhs;
|
||||
}
|
||||
@ -1103,7 +1103,7 @@ struct deref_less_than {
|
||||
|
||||
class NodeVecCache: public CacheStats {
|
||||
public:
|
||||
set<hashedNodeVec *, deref_less_than> cache;
|
||||
set<NodeVec *, deref_less_than> cache;
|
||||
|
||||
NodeVecCache(void): cache() { };
|
||||
~NodeVecCache() { clear(); };
|
||||
@ -1112,7 +1112,7 @@ public:
|
||||
|
||||
void clear()
|
||||
{
|
||||
for (set<hashedNodeVec *>::iterator i = cache.begin();
|
||||
for (set<NodeVec *>::iterator i = cache.begin();
|
||||
i != cache.end(); i++) {
|
||||
delete *i;
|
||||
}
|
||||
@ -1120,12 +1120,12 @@ public:
|
||||
CacheStats::clear();
|
||||
}
|
||||
|
||||
hashedNodeVec *insert(NodeSet *nodes)
|
||||
NodeVec *insert(NodeSet *nodes)
|
||||
{
|
||||
if (!nodes)
|
||||
return NULL;
|
||||
pair<set<hashedNodeVec *>::iterator,bool> uniq;
|
||||
hashedNodeVec *nv = new hashedNodeVec(nodes);
|
||||
pair<set<NodeVec *>::iterator,bool> uniq;
|
||||
NodeVec *nv = new NodeVec(nodes);
|
||||
uniq = cache.insert(nv);
|
||||
if (uniq.second == false) {
|
||||
delete nv;
|
||||
|
@ -303,7 +303,7 @@ static void split_node_types(NodeSet *nodes, NodeSet **anodes, NodeSet **nnodes
|
||||
|
||||
State *DFA::add_new_state(NodeSet *anodes, NodeSet *nnodes, State *other)
|
||||
{
|
||||
hashedNodeVec *nnodev;
|
||||
NodeVec *nnodev;
|
||||
nnodev = nnodes_cache.insert(nnodes);
|
||||
anodes = anodes_cache.insert(anodes);
|
||||
|
||||
@ -347,7 +347,7 @@ void DFA::update_state_transitions(State *state)
|
||||
* need to compute follow for the accept nodes in a protostate
|
||||
*/
|
||||
Cases cases;
|
||||
for (hashedNodeVec::iterator i = state->proto.nnodes->begin(); i != state->proto.nnodes->end(); i++)
|
||||
for (NodeVec::iterator i = state->proto.nnodes->begin(); i != state->proto.nnodes->end(); i++)
|
||||
(*i)->follow(cases);
|
||||
|
||||
/* Now for each set of nodes in the computed transitions, make
|
||||
|
@ -140,13 +140,13 @@ int accept_perms(NodeSet *state, perms_t &perms, bool filedfa);
|
||||
*/
|
||||
class ProtoState {
|
||||
public:
|
||||
hashedNodeVec *nnodes;
|
||||
NodeVec *nnodes;
|
||||
NodeSet *anodes;
|
||||
|
||||
/* init is used instead of a constructor because ProtoState is used
|
||||
* in a union
|
||||
*/
|
||||
void init(hashedNodeVec *n, NodeSet *a = NULL)
|
||||
void init(NodeVec *n, NodeSet *a = NULL)
|
||||
{
|
||||
nnodes = n;
|
||||
anodes = a;
|
||||
|
Loading…
x
Reference in New Issue
Block a user