aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/include/unicode/bytestrie.h
diff options
context:
space:
mode:
authormcheshkov <mcheshkov@yandex-team.ru>2022-02-10 16:46:16 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:16 +0300
commit1312621288956f199a5bd5342b0133d4395fa725 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/icu/include/unicode/bytestrie.h
parente9d19cec64684c9c1e6b0c98297e5b895cf904fe (diff)
downloadydb-1312621288956f199a5bd5342b0133d4395fa725.tar.gz
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/icu/include/unicode/bytestrie.h')
-rw-r--r--contrib/libs/icu/include/unicode/bytestrie.h98
1 files changed, 49 insertions, 49 deletions
diff --git a/contrib/libs/icu/include/unicode/bytestrie.h b/contrib/libs/icu/include/unicode/bytestrie.h
index d6550af23d..51405f64a1 100644
--- a/contrib/libs/icu/include/unicode/bytestrie.h
+++ b/contrib/libs/icu/include/unicode/bytestrie.h
@@ -1,4 +1,4 @@
-// © 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bytestrie.h
-* encoding: UTF-8
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -23,9 +23,9 @@
*/
#include "unicode/utypes.h"
-
-#if U_SHOW_CPLUSPLUS_API
-
+
+#if U_SHOW_CPLUSPLUS_API
+
#include "unicode/stringpiece.h"
#include "unicode/uobject.h"
#include "unicode/ustringtrie.h"
@@ -97,42 +97,42 @@ public:
return *this;
}
-#ifndef U_HIDE_DRAFT_API
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Returns the state of this trie as a 64-bit integer.
+ * The state value is never 0.
+ *
+ * @return opaque state value
+ * @see resetToState64
+ * @draft ICU 65
+ */
+ uint64_t getState64() const {
+ return (static_cast<uint64_t>(remainingMatchLength_ + 2) << kState64RemainingShift) |
+ (uint64_t)(pos_ - bytes_);
+ }
+
+ /**
+ * Resets this trie to the saved state.
+ * Unlike resetToState(State), the 64-bit state value
+ * must be from getState64() from the same trie object or
+ * from one initialized the exact same way.
+ * Because of no validation, this method is faster.
+ *
+ * @param state The opaque trie state value from getState64().
+ * @return *this
+ * @see getState64
+ * @see resetToState
+ * @see reset
+ * @draft ICU 65
+ */
+ BytesTrie &resetToState64(uint64_t state) {
+ remainingMatchLength_ = static_cast<int32_t>(state >> kState64RemainingShift) - 2;
+ pos_ = bytes_ + (state & kState64PosMask);
+ return *this;
+ }
+#endif /* U_HIDE_DRAFT_API */
+
/**
- * Returns the state of this trie as a 64-bit integer.
- * The state value is never 0.
- *
- * @return opaque state value
- * @see resetToState64
- * @draft ICU 65
- */
- uint64_t getState64() const {
- return (static_cast<uint64_t>(remainingMatchLength_ + 2) << kState64RemainingShift) |
- (uint64_t)(pos_ - bytes_);
- }
-
- /**
- * Resets this trie to the saved state.
- * Unlike resetToState(State), the 64-bit state value
- * must be from getState64() from the same trie object or
- * from one initialized the exact same way.
- * Because of no validation, this method is faster.
- *
- * @param state The opaque trie state value from getState64().
- * @return *this
- * @see getState64
- * @see resetToState
- * @see reset
- * @draft ICU 65
- */
- BytesTrie &resetToState64(uint64_t state) {
- remainingMatchLength_ = static_cast<int32_t>(state >> kState64RemainingShift) - 2;
- pos_ = bytes_ + (state & kState64PosMask);
- return *this;
- }
-#endif /* U_HIDE_DRAFT_API */
-
- /**
* BytesTrie state object, for saving a trie's current state
* and resetting the trie back to this state later.
* @stable ICU 4.8
@@ -540,13 +540,13 @@ private:
static const int32_t kMaxTwoByteDelta=((kMinThreeByteDeltaLead-kMinTwoByteDeltaLead)<<8)-1; // 0x2fff
static const int32_t kMaxThreeByteDelta=((kFourByteDeltaLead-kMinThreeByteDeltaLead)<<16)-1; // 0xdffff
- // For getState64():
- // The remainingMatchLength_ is -1..14=(kMaxLinearMatchLength=0x10)-2
- // so we need at least 5 bits for that.
- // We add 2 to store it as a positive value 1..16=kMaxLinearMatchLength.
- static constexpr int32_t kState64RemainingShift = 59;
- static constexpr uint64_t kState64PosMask = (UINT64_C(1) << kState64RemainingShift) - 1;
-
+ // For getState64():
+ // The remainingMatchLength_ is -1..14=(kMaxLinearMatchLength=0x10)-2
+ // so we need at least 5 bits for that.
+ // We add 2 to store it as a positive value 1..16=kMaxLinearMatchLength.
+ static constexpr int32_t kState64RemainingShift = 59;
+ static constexpr uint64_t kState64PosMask = (UINT64_C(1) << kState64RemainingShift) - 1;
+
uint8_t *ownedArray_;
// Fixed value referencing the BytesTrie bytes.
@@ -562,6 +562,6 @@ private:
U_NAMESPACE_END
-#endif /* U_SHOW_CPLUSPLUS_API */
-
+#endif /* U_SHOW_CPLUSPLUS_API */
+
#endif // __BYTESTRIE_H__