diff --git a/src/node_http2.cc b/src/node_http2.cc index 888f70bd4df8a3..f9b5226aea50dc 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -1316,11 +1316,7 @@ int Http2Session::OnDataChunkReceived(nghttp2_session* handle, } else { memcpy(buf.base, data, avail); } - if (buf.base == nullptr) [[likely]] { - buf.base = reinterpret_cast(const_cast(data)); - } else { - memcpy(buf.base, data, avail); - } + data += avail; len -= avail; stream->EmitRead(avail, buf);