aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/hyperscan/src/hwlm/hwlm_literal.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/hwlm/hwlm_literal.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/hwlm/hwlm_literal.h')
-rw-r--r--contrib/libs/hyperscan/src/hwlm/hwlm_literal.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/contrib/libs/hyperscan/src/hwlm/hwlm_literal.h b/contrib/libs/hyperscan/src/hwlm/hwlm_literal.h
index 6d709157fa..598de81471 100644
--- a/contrib/libs/hyperscan/src/hwlm/hwlm_literal.h
+++ b/contrib/libs/hyperscan/src/hwlm/hwlm_literal.h
@@ -37,7 +37,7 @@
#include "ue2common.h"
#include <string>
-#include <tuple>
+#include <tuple>
#include <vector>
namespace ue2 {
@@ -45,8 +45,8 @@ namespace ue2 {
/** \brief Max length of the hwlmLiteral::msk and hwlmLiteral::cmp vectors. */
#define HWLM_MASKLEN 8
-#define INVALID_LIT_ID ~0U
-
+#define INVALID_LIT_ID ~0U
+
/** \brief Class representing a literal, fed to \ref hwlmBuild. */
struct hwlmLiteral {
std::string s; //!< \brief The literal itself.
@@ -66,21 +66,21 @@ struct hwlmLiteral {
* can be quashed by the literal matcher. */
bool noruns;
- /** \brief included literal id. */
- u32 included_id = INVALID_LIT_ID;
-
- /** \brief Squash mask for FDR's confirm mask for included literals.
- *
- * In FDR confirm, if we have included literal in another bucket,
- * we can use this mask to squash the bit for the bucket in FDR confirm
- * mask and then run programs of included literal directly and avoid
- * confirm work.
- *
- * This value is calculated in FDR compile code once bucket assignment is
- * completed
- */
- u8 squash = 0;
-
+ /** \brief included literal id. */
+ u32 included_id = INVALID_LIT_ID;
+
+ /** \brief Squash mask for FDR's confirm mask for included literals.
+ *
+ * In FDR confirm, if we have included literal in another bucket,
+ * we can use this mask to squash the bit for the bucket in FDR confirm
+ * mask and then run programs of included literal directly and avoid
+ * confirm work.
+ *
+ * This value is calculated in FDR compile code once bucket assignment is
+ * completed
+ */
+ u8 squash = 0;
+
/** \brief Set of groups that literal belongs to.
*
* Use \ref HWLM_ALL_GROUPS for a literal that could match regardless of
@@ -120,27 +120,27 @@ struct hwlmLiteral {
hwlmLiteral(const std::string &s_in, bool nocase_in, bool noruns_in,
u32 id_in, hwlm_group_t groups_in,
const std::vector<u8> &msk_in, const std::vector<u8> &cmp_in);
-
+
/** \brief Simple constructor: no group information, no msk/cmp.
*
* This constructor is only used in internal unit test. */
- hwlmLiteral(const std::string &s_in, bool nocase_in, u32 id_in)
- : hwlmLiteral(s_in, nocase_in, false, id_in, HWLM_ALL_GROUPS, {}, {}) {}
+ hwlmLiteral(const std::string &s_in, bool nocase_in, u32 id_in)
+ : hwlmLiteral(s_in, nocase_in, false, id_in, HWLM_ALL_GROUPS, {}, {}) {}
};
-inline
-bool operator<(const hwlmLiteral &a, const hwlmLiteral &b) {
- return std::tie(a.id, a.s, a.nocase, a.noruns, a.groups, a.msk, a.cmp) <
- std::tie(b.id, b.s, b.nocase, b.noruns, b.groups, b.msk, b.cmp);
-}
-
-inline
-bool operator==(const hwlmLiteral &a, const hwlmLiteral &b) {
- return a.id == b.id && a.s == b.s && a.nocase == b.nocase &&
- a.noruns == b.noruns && a.groups == b.groups && a.msk == b.msk &&
- a.cmp == b.cmp;
-}
-
+inline
+bool operator<(const hwlmLiteral &a, const hwlmLiteral &b) {
+ return std::tie(a.id, a.s, a.nocase, a.noruns, a.groups, a.msk, a.cmp) <
+ std::tie(b.id, b.s, b.nocase, b.noruns, b.groups, b.msk, b.cmp);
+}
+
+inline
+bool operator==(const hwlmLiteral &a, const hwlmLiteral &b) {
+ return a.id == b.id && a.s == b.s && a.nocase == b.nocase &&
+ a.noruns == b.noruns && a.groups == b.groups && a.msk == b.msk &&
+ a.cmp == b.cmp;
+}
+
/**
* Consistency test; returns false if the given msk/cmp test can never match
* the literal string s.