Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix format, update comment
  • Loading branch information
kvakil committed Sep 14, 2022
commit e385eef07fc67fc1e6c31e4a153ed27fd2018c66
6 changes: 2 additions & 4 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,11 @@ char* Data(Local<Value> val) {
// latter returns `NULL`. At least one library in the ecosystem (see the
// referenced issue) abuses zero-length buffers to wrap arbitrary pointers,
// which is broken by this difference. It is unfortunate that every library
// needs to take a performance hit because of this edge-case, and somebody
// should figure out if this is actually a reasonable contract to uphold
// long-term.
// needs to take a performance hit because of this edge-case, so this change
// is only being backported to older Node.js releases.
//
// See: https://github.com/nodejs/node/issues/44554
return static_cast<char*>(ui->Buffer()->GetBackingStore()->Data()) +

ui->ByteOffset();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return static_cast<char*>(ui->Buffer()->GetBackingStore()->Data()) +
ui->ByteOffset();
return static_cast<char*>(ui->Buffer()->GetBackingStore()->Data()) +
ui->ByteOffset();

(Not sure what indentation will make format-cpp happy, though.)

}

Expand Down