Skip to content

Commit f3acd38

Browse files
committed
simplify definition of BOOST_JSON_LIKELY/UNLIKELY
1 parent b7f4665 commit f3acd38

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

include/boost/json/detail/config.hpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,11 @@
7979
#endif
8080

8181
#ifndef BOOST_JSON_LIKELY
82-
# if defined(__GNUC__) || defined(__clang__)
83-
# define BOOST_JSON_LIKELY(x) __builtin_expect(!!(x), 1)
84-
# else
85-
# define BOOST_JSON_LIKELY(x) x
86-
# endif
82+
# define BOOST_JSON_LIKELY(x) BOOST_LIKELY( !!(x) )
8783
#endif
8884

8985
#ifndef BOOST_JSON_UNLIKELY
90-
# if defined(__GNUC__) || defined(__clang__)
91-
# define BOOST_JSON_UNLIKELY(x) __builtin_expect(!!(x), 0)
92-
# else
93-
# define BOOST_JSON_UNLIKELY(x) x
94-
# endif
86+
# define BOOST_JSON_UNLIKELY(x) BOOST_UNLIKELY( !!(x) )
9587
#endif
9688

9789
#ifndef BOOST_JSON_UNREACHABLE

0 commit comments

Comments
 (0)