protobuf: mark unlikely branch as so

Don't leave things to chance. We generally mark likely/unlikely
branches on hot paths as such.

PiperOrigin-RevId: 561288632
pull/13788/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent e454cb50fc
commit 293f0a3b31
  1. 2
      php/ext/google/protobuf/php-upb.c
  2. 2
      ruby/ext/google/protobuf_c/ruby-upb.c
  3. 2
      src/google/protobuf/serial_arena.h

@ -1,6 +1,8 @@
/* Amalgamated source file */
#include "php-upb.h"
test-xyz
/*
* This is where we define internal portability macros used across upb.
*

@ -1,6 +1,8 @@
/* Amalgamated source file */
#include "ruby-upb.h"
test-xyz
/*
* This is where we define internal portability macros used across upb.
*

@ -133,7 +133,7 @@ class PROTOBUF_EXPORT SerialArena {
// the pattern we are looking for.
const size_t index = absl::bit_width(size - 1) - 4;
if (index >= cached_block_length_) return nullptr;
if (PROTOBUF_PREDICT_FALSE(index >= cached_block_length_)) return nullptr;
auto& cached_head = cached_blocks_[index];
if (cached_head == nullptr) return nullptr;

Loading…
Cancel
Save