File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ IncomingMsg::~IncomingMsg() {
1515}
1616
1717Napi::Value IncomingMsg::IntoBuffer (const Napi::Env& env) {
18- if (!hasElectronMemoryCage (env)) {
18+ static auto const noElectronMemoryCage = !hasElectronMemoryCage (env);
19+ if (noElectronMemoryCage) {
1920 if (moved) {
2021 /* If ownership has been transferred, do not attempt to read the buffer
2122 again in any case. This should not happen of course. */
@@ -26,7 +27,7 @@ Napi::Value IncomingMsg::IntoBuffer(const Napi::Env& env) {
2627 auto data = reinterpret_cast <uint8_t *>(zmq_msg_data (*ref));
2728 auto length = zmq_msg_size (*ref);
2829
29- if (! hasElectronMemoryCage (env) ) {
30+ if (noElectronMemoryCage ) {
3031 static auto constexpr zero_copy_threshold = 1 << 7 ;
3132 if (length > zero_copy_threshold) {
3233 /* Reuse existing buffer for external storage. This avoids copying but
You can’t perform that action at this time.
0 commit comments