aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/hyperscan/src/rose/infix.h
diff options
context:
space:
mode:
authorIvan Blinkov <ivan@blinkov.ru>2022-02-10 16:47:11 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:11 +0300
commit5b283123c882433dafbaf6b338adeea16c1a0ea0 (patch)
tree339adc63bce23800021202ae4a8328a843dc447a /contrib/libs/hyperscan/src/rose/infix.h
parent1aeb9a455974457866f78722ad98114bafc84e8a (diff)
downloadydb-5b283123c882433dafbaf6b338adeea16c1a0ea0.tar.gz
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/src/rose/infix.h')
-rw-r--r--contrib/libs/hyperscan/src/rose/infix.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/contrib/libs/hyperscan/src/rose/infix.h b/contrib/libs/hyperscan/src/rose/infix.h
index cfae16abd9..9cf9c0ad74 100644
--- a/contrib/libs/hyperscan/src/rose/infix.h
+++ b/contrib/libs/hyperscan/src/rose/infix.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016, 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:
@@ -32,7 +32,7 @@
#include "ue2common.h"
#include "nfa/nfa_api.h"
#include "nfa/nfa_api_queue.h"
-#include "nfa/nfa_internal.h"
+#include "nfa/nfa_internal.h"
static really_inline
int infixTooOld(struct mq *q, s64a curr_loc) {
@@ -45,27 +45,27 @@ int infixTooOld(struct mq *q, s64a curr_loc) {
return q_last_loc(q) + maxAge < curr_loc;
}
-static really_inline
-int canReduceQueue(const struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
- u32 qlen = q->end - q->cur; /* includes MQE_START */
-
- if (maxAge && q->items[q->cur].location + maxAge < curr_loc) {
- return 1;
- }
-
- if (qlen - 1 > maxTops) {
- return 1;
- }
-
- if (qlen - 1 == maxTops
- && q->items[q->cur].location != q->items[q->cur + 1].location) {
- /* we can advance start to the first top location */
- return 1;
- }
-
- return 0;
-}
-
+static really_inline
+int canReduceQueue(const struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
+ u32 qlen = q->end - q->cur; /* includes MQE_START */
+
+ if (maxAge && q->items[q->cur].location + maxAge < curr_loc) {
+ return 1;
+ }
+
+ if (qlen - 1 > maxTops) {
+ return 1;
+ }
+
+ if (qlen - 1 == maxTops
+ && q->items[q->cur].location != q->items[q->cur + 1].location) {
+ /* we can advance start to the first top location */
+ return 1;
+ }
+
+ return 0;
+}
+
/**
* Removes tops which are known not to affect the final state from the queue.
* May also reinitialise the engine state if it is unneeded.
@@ -84,14 +84,14 @@ int canReduceQueue(const struct mq *q, s64a curr_loc, u32 maxTops, u32 maxAge) {
* engine.
*/
static really_inline
-void reduceInfixQueue(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);
- if (!canReduceQueue(q, curr_loc, maxTops, maxAge)) {
+ if (!canReduceQueue(q, curr_loc, maxTops, maxAge)) {
DEBUG_PRINTF("nothing to do\n");
return;
}