@@ -892,8 +892,9 @@ int SoaTraits::Send(QueryWrap<SoaTraits>* wrap, const char* name) {
892
892
int AnyTraits::Parse (
893
893
QueryAnyWrap* wrap,
894
894
const std::unique_ptr<ResponseData>& response) {
895
- if (UNLIKELY ( response->is_host ))
895
+ if (response->is_host ) [[unlikely]] {
896
896
return ARES_EBADRESP;
897
+ }
897
898
898
899
unsigned char * buf = response->buf .data ;
899
900
int len = response->buf .size ;
@@ -1059,8 +1060,9 @@ int AnyTraits::Parse(
1059
1060
int ATraits::Parse (
1060
1061
QueryAWrap* wrap,
1061
1062
const std::unique_ptr<ResponseData>& response) {
1062
- if (UNLIKELY ( response->is_host ))
1063
+ if (response->is_host ) [[unlikely]] {
1063
1064
return ARES_EBADRESP;
1065
+ }
1064
1066
1065
1067
unsigned char * buf = response->buf .data ;
1066
1068
int len = response->buf .size ;
@@ -1093,8 +1095,9 @@ int ATraits::Parse(
1093
1095
int AaaaTraits::Parse (
1094
1096
QueryAaaaWrap* wrap,
1095
1097
const std::unique_ptr<ResponseData>& response) {
1096
- if (UNLIKELY ( response->is_host ))
1098
+ if (response->is_host ) [[unlikely]] {
1097
1099
return ARES_EBADRESP;
1100
+ }
1098
1101
1099
1102
unsigned char * buf = response->buf .data ;
1100
1103
int len = response->buf .size ;
@@ -1127,8 +1130,9 @@ int AaaaTraits::Parse(
1127
1130
int CaaTraits::Parse (
1128
1131
QueryCaaWrap* wrap,
1129
1132
const std::unique_ptr<ResponseData>& response) {
1130
- if (UNLIKELY ( response->is_host ))
1133
+ if (response->is_host ) [[unlikely]] {
1131
1134
return ARES_EBADRESP;
1135
+ }
1132
1136
1133
1137
unsigned char * buf = response->buf .data ;
1134
1138
int len = response->buf .size ;
@@ -1149,8 +1153,9 @@ int CaaTraits::Parse(
1149
1153
int CnameTraits::Parse (
1150
1154
QueryCnameWrap* wrap,
1151
1155
const std::unique_ptr<ResponseData>& response) {
1152
- if (UNLIKELY ( response->is_host ))
1156
+ if (response->is_host ) [[unlikely]] {
1153
1157
return ARES_EBADRESP;
1158
+ }
1154
1159
1155
1160
unsigned char * buf = response->buf .data ;
1156
1161
int len = response->buf .size ;
@@ -1172,8 +1177,9 @@ int CnameTraits::Parse(
1172
1177
int MxTraits::Parse (
1173
1178
QueryMxWrap* wrap,
1174
1179
const std::unique_ptr<ResponseData>& response) {
1175
- if (UNLIKELY ( response->is_host ))
1180
+ if (response->is_host ) [[unlikely]] {
1176
1181
return ARES_EBADRESP;
1182
+ }
1177
1183
1178
1184
unsigned char * buf = response->buf .data ;
1179
1185
int len = response->buf .size ;
@@ -1195,8 +1201,9 @@ int MxTraits::Parse(
1195
1201
int NsTraits::Parse (
1196
1202
QueryNsWrap* wrap,
1197
1203
const std::unique_ptr<ResponseData>& response) {
1198
- if (UNLIKELY ( response->is_host ))
1204
+ if (response->is_host ) [[unlikely]] {
1199
1205
return ARES_EBADRESP;
1206
+ }
1200
1207
1201
1208
unsigned char * buf = response->buf .data ;
1202
1209
int len = response->buf .size ;
@@ -1218,8 +1225,9 @@ int NsTraits::Parse(
1218
1225
int TxtTraits::Parse (
1219
1226
QueryTxtWrap* wrap,
1220
1227
const std::unique_ptr<ResponseData>& response) {
1221
- if (UNLIKELY ( response->is_host ))
1228
+ if (response->is_host ) [[unlikely]] {
1222
1229
return ARES_EBADRESP;
1230
+ }
1223
1231
1224
1232
unsigned char * buf = response->buf .data ;
1225
1233
int len = response->buf .size ;
@@ -1240,8 +1248,9 @@ int TxtTraits::Parse(
1240
1248
int SrvTraits::Parse (
1241
1249
QuerySrvWrap* wrap,
1242
1250
const std::unique_ptr<ResponseData>& response) {
1243
- if (UNLIKELY ( response->is_host ))
1251
+ if (response->is_host ) [[unlikely]] {
1244
1252
return ARES_EBADRESP;
1253
+ }
1245
1254
1246
1255
unsigned char * buf = response->buf .data ;
1247
1256
int len = response->buf .size ;
@@ -1262,9 +1271,9 @@ int SrvTraits::Parse(
1262
1271
int PtrTraits::Parse (
1263
1272
QueryPtrWrap* wrap,
1264
1273
const std::unique_ptr<ResponseData>& response) {
1265
- if (UNLIKELY ( response->is_host ))
1274
+ if (response->is_host ) [[unlikely]] {
1266
1275
return ARES_EBADRESP;
1267
-
1276
+ }
1268
1277
unsigned char * buf = response->buf .data ;
1269
1278
int len = response->buf .size ;
1270
1279
@@ -1286,9 +1295,9 @@ int PtrTraits::Parse(
1286
1295
int NaptrTraits::Parse (
1287
1296
QueryNaptrWrap* wrap,
1288
1297
const std::unique_ptr<ResponseData>& response) {
1289
- if (UNLIKELY ( response->is_host ))
1298
+ if (response->is_host ) [[unlikely]] {
1290
1299
return ARES_EBADRESP;
1291
-
1300
+ }
1292
1301
unsigned char * buf = response->buf .data ;
1293
1302
int len = response->buf .size ;
1294
1303
@@ -1308,9 +1317,9 @@ int NaptrTraits::Parse(
1308
1317
int SoaTraits::Parse (
1309
1318
QuerySoaWrap* wrap,
1310
1319
const std::unique_ptr<ResponseData>& response) {
1311
- if (UNLIKELY ( response->is_host ))
1320
+ if (response->is_host ) [[unlikely]] {
1312
1321
return ARES_EBADRESP;
1313
-
1322
+ }
1314
1323
unsigned char * buf = response->buf .data ;
1315
1324
int len = response->buf .size ;
1316
1325
@@ -1388,9 +1397,9 @@ int ReverseTraits::Send(GetHostByAddrWrap* wrap, const char* name) {
1388
1397
int ReverseTraits::Parse (
1389
1398
GetHostByAddrWrap* wrap,
1390
1399
const std::unique_ptr<ResponseData>& response) {
1391
- if (UNLIKELY ( !response->is_host ))
1400
+ if (!response->is_host ) [[unlikely]] {
1392
1401
return ARES_EBADRESP;
1393
-
1402
+ }
1394
1403
struct hostent * host = response->host .get ();
1395
1404
1396
1405
Environment* env = wrap->env ();
0 commit comments