mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
src: modernize likely/unlikely hints
PR-URL: https://github.com/nodejs/node/pull/55155 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
1 parent
3111ed7011
commit
317d2450f9
53 files changed
+287
-219
No files matched your search
@@ -114,7 +114,7 @@ MaybeLocal<String> StringDecoder::DecodeData(Isolate* isolate,
|
||||
state_[kMissingBytes] -= found_bytes;
|
||||
state_[kBufferedBytes] += found_bytes;
|
||||
|
||||
if (LIKELY(MissingBytes() == 0)) {
|
||||
if (MissingBytes() == 0) [[likely]] {
|
||||
// If no more bytes are missing, create a small string that we
|
||||
// will later prepend.
|
||||
if (!MakeString(isolate,
|
||||
@@ -132,7 +132,7 @@ MaybeLocal<String> StringDecoder::DecodeData(Isolate* isolate,
|
||||
|
||||
// It could be that trying to finish the previous chunk already
|
||||
// consumed all data that we received in this chunk.
|
||||
if (UNLIKELY(nread == 0)) {
|
||||
if (nread == 0) [[unlikely]] {
|
||||
body = !prepend.IsEmpty() ? prepend : String::Empty(isolate);
|
||||
prepend = Local<String>();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user