Rename reduceQueue to reduceInfixQueue

This commit is contained in:
Justin Viiret 2016-02-11 14:38:12 +11:00 committed by Matthew Barr
parent bba8b62635
commit 8f3471dd4e
3 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Intel Corporation
* Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -63,12 +63,13 @@ int infixTooOld(struct mq *q, s64a curr_loc) {
* engine.
*/
static really_inline
void reduceQueue(struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
void reduceInfixQueue(struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
assert(q->end > q->cur);
assert(maxTops);
u32 qlen = q->end - q->cur; /* includes MQE_START */
DEBUG_PRINTF("q=%p, len=%u, maxTops=%u maxAge=%u\n", q, qlen, maxTops,
maxAge);
char any_work = 0;
if (maxAge && q->items[q->cur].location + maxAge < curr_loc) {
any_work = 1;

View File

@ -442,7 +442,7 @@ char roseTestLeftfix(const struct RoseEngine *t, struct hs_scratch *scratch,
goto nfa_dead;
}
reduceQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
reduceInfixQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
}
if (!rosePrefixCheckMiracles(t, left, ci, q, end)) {
@ -540,10 +540,10 @@ void roseTriggerInfix(const struct RoseEngine *t, struct hs_scratch *scratch,
pushQueueAt(q, 0, MQE_START, loc);
nfaQueueInitState(q->nfa, q);
} else if (isQueueFull(q)) {
reduceQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
reduceInfixQueue(q, loc, left->maxQueueLen, q->nfa->maxWidth);
if (isQueueFull(q)) {
/* still full - reduceQueue did nothing */
/* still full - reduceInfixQueue did nothing */
DEBUG_PRINTF("queue %u full (%u items) -> catching up nfa\n", qi,
q->end - q->cur);
pushQueueNoMerge(q, MQE_END, loc);

View File

@ -291,7 +291,7 @@ char roseCatchUpLeftfix(const struct RoseEngine *t, char *state,
DEBUG_PRINTF("infix died of old age\n");
return 0;
}
reduceQueue(q, last_loc, left->maxQueueLen, q->nfa->maxWidth);
reduceInfixQueue(q, last_loc, left->maxQueueLen, q->nfa->maxWidth);
}
DEBUG_PRINTF("end scan at %lld\n", last_loc);