summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/string-comparator.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2021-02-24 14:47:06 +0100
committerMichaël Zasso <targos@protonmail.com>2021-02-25 00:14:47 +0100
commitc5ff019a4e93891106859cb272ded1197a92c7e5 (patch)
treecaf6b7e50b0ceac09878ac4402d9f725b8685dd7 /deps/v8/src/objects/string-comparator.h
parent67dc2bf2084b125dec43689874d237d125562cdf (diff)
downloadnode-new-c5ff019a4e93891106859cb272ded1197a92c7e5.tar.gz
deps: update V8 to 8.9.255.19
PR-URL: https://github.com/nodejs/node/pull/37330 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/src/objects/string-comparator.h')
-rw-r--r--deps/v8/src/objects/string-comparator.h40
1 files changed, 1 insertions, 39 deletions
diff --git a/deps/v8/src/objects/string-comparator.h b/deps/v8/src/objects/string-comparator.h
index dc58d9aeb2..59acd42087 100644
--- a/deps/v8/src/objects/string-comparator.h
+++ b/deps/v8/src/objects/string-comparator.h
@@ -13,44 +13,6 @@
namespace v8 {
namespace internal {
-// Compares the contents of two strings by reading and comparing
-// int-sized blocks of characters.
-template <typename Char>
-static inline bool CompareRawStringContents(const Char* const a,
- const Char* const b, int length) {
- return CompareChars(a, b, length) == 0;
-}
-
-template <typename Chars1, typename Chars2>
-class RawStringComparator : public AllStatic {
- public:
- static inline bool compare(const Chars1* a, const Chars2* b, int len) {
- DCHECK(sizeof(Chars1) != sizeof(Chars2));
- for (int i = 0; i < len; i++) {
- if (a[i] != b[i]) {
- return false;
- }
- }
- return true;
- }
-};
-
-template <>
-class RawStringComparator<uint16_t, uint16_t> {
- public:
- static inline bool compare(const uint16_t* a, const uint16_t* b, int len) {
- return CompareRawStringContents(a, b, len);
- }
-};
-
-template <>
-class RawStringComparator<uint8_t, uint8_t> {
- public:
- static inline bool compare(const uint8_t* a, const uint8_t* b, int len) {
- return CompareRawStringContents(a, b, len);
- }
-};
-
class StringComparator {
class State {
public:
@@ -92,7 +54,7 @@ class StringComparator {
static inline bool Equals(State* state_1, State* state_2, int to_check) {
const Chars1* a = reinterpret_cast<const Chars1*>(state_1->buffer8_);
const Chars2* b = reinterpret_cast<const Chars2*>(state_2->buffer8_);
- return RawStringComparator<Chars1, Chars2>::compare(a, b, to_check);
+ return CompareCharsEqual(a, b, to_check);
}
bool Equals(String string_1, String string_2);