diff options
author | Tobias Nießen <tniessen@tnie.de> | 2020-07-12 23:40:54 +0300 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2020-07-19 13:36:28 +0300 |
commit | efd16672185e85611d995eec36474eaf1fed39cc (patch) | |
tree | 3e44606aa4734a27a835ec837c2fdd3023efd42f /src/util.h | |
parent | e3f8dc166a6969358821f3219bb7b2a709820887 (diff) |
src: avoid strcmp in SecureContext::Init
PR-URL: https://github.com/nodejs/node/pull/34329
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 71f3886365e..d3c5fdd74ed 100644 --- a/src/util.h +++ b/src/util.h @@ -491,6 +491,10 @@ class Utf8Value : public MaybeStackBuffer<char> { explicit Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> value); inline std::string ToString() const { return std::string(out(), length()); } + + inline bool operator==(const char* a) const { + return strcmp(out(), a) == 0; + } }; class TwoByteValue : public MaybeStackBuffer<uint16_t> { |