324 | 892k | } Unexecuted instantiation: _ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz10member_apiELm0ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm8EcEEbPKT1_ Unexecuted instantiation: _ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz10member_apiELm1ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Unexecuted instantiation: _ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz10member_apiELm2ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm5EcEEbPKT1_ Unexecuted instantiation: _ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz10member_apiELm3ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ _ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz5pointELm0ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm2EcEEbPKT1_ Line | Count | Source | 245 | 5.84k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | 5.84k | else if constexpr (N == 2) { | 304 | 5.84k | static constexpr auto packed = pack<Str, 2>(); | 305 | 5.84k | uint16_t in; | 306 | 5.84k | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | 5.84k | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 5.84k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz5pointELm1ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm2EcEEbPKT1_ Line | Count | Source | 245 | 1.36k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | 1.36k | else if constexpr (N == 2) { | 304 | 1.36k | static constexpr auto packed = pack<Str, 2>(); | 305 | 1.36k | uint16_t in; | 306 | 1.36k | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | 1.36k | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 1.36k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm0ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 17.4k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 17.4k | else if constexpr (N == 6) { | 268 | 17.4k | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 17.4k | uint64_t in{}; | 270 | 17.4k | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 17.4k | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 17.4k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm1ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm5EcEEbPKT1_ Line | Count | Source | 245 | 136 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | 136 | else if constexpr (N == 5) { | 277 | 136 | static constexpr auto packed = pack<Str, 4>(); | 278 | 136 | uint32_t in; | 279 | 136 | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | 136 | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 136 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm2ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm9EcEEbPKT1_ Line | Count | Source | 245 | 904 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | 904 | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | 904 | return 0 == std::memcmp(Str.data(), other, N); | 323 | 904 | } | 324 | 904 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm3ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 722 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 722 | else if constexpr (N == 6) { | 268 | 722 | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 722 | uint64_t in{}; | 270 | 722 | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 722 | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 722 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz6nestedELm0ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 15.6k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 15.6k | else if constexpr (N == 6) { | 268 | 15.6k | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 15.6k | uint64_t in{}; | 270 | 15.6k | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 15.6k | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 15.6k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz6nestedELm1ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 829 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 829 | else if constexpr (N == 6) { | 268 | 829 | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 829 | uint64_t in{}; | 270 | 829 | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 829 | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 829 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm4ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm7EcEEbPKT1_ Line | Count | Source | 245 | 8.20k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | 8.20k | else if constexpr (N == 7) { | 259 | 8.20k | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | 8.20k | uint64_t in{}; | 261 | 8.20k | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | 8.20k | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 8.20k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm5ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 1.21k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 1.21k | else if constexpr (N == 6) { | 268 | 1.21k | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 1.21k | uint64_t in{}; | 270 | 1.21k | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 1.21k | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 1.21k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm6ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 1.41k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 1.41k | else if constexpr (N == 6) { | 268 | 1.41k | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 1.41k | uint64_t in{}; | 270 | 1.41k | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 1.41k | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 1.41k | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc117ELc108ELc108EEEETnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_E1SELm3EcEEbPKSB_ Line | Count | Source | 245 | 1.28k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | 1.28k | else if constexpr (N == 3) { | 295 | 1.28k | static constexpr auto packed = pack<Str, 2>(); | 296 | 1.28k | uint16_t in; | 297 | 1.28k | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | 1.28k | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 1.28k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm7ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm8EcEEbPKT1_ Line | Count | Source | 245 | 1.53k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | 1.53k | if constexpr (N == 8) { | 250 | 1.53k | static constexpr auto packed = pack<Str, 8>(); | 251 | 1.53k | uint64_t in; | 252 | 1.53k | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | 1.53k | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 1.53k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz6amountELm0ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 431 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 431 | else if constexpr (N == 6) { | 268 | 431 | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 431 | uint64_t in{}; | 270 | 431 | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 431 | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 431 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm8ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm8EcEEbPKT1_ Line | Count | Source | 245 | 501 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | 501 | if constexpr (N == 8) { | 250 | 501 | static constexpr auto packed = pack<Str, 8>(); | 251 | 501 | uint64_t in; | 252 | 501 | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | 501 | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 501 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm9ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 426 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 426 | else if constexpr (N == 6) { | 268 | 426 | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 426 | uint64_t in{}; | 270 | 426 | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 426 | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 426 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm10ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm9EcEEbPKT1_ Line | Count | Source | 245 | 438 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | 438 | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | 438 | return 0 == std::memcmp(Str.data(), other, N); | 323 | 438 | } | 324 | 438 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm11ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 323 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 323 | else if constexpr (N == 6) { | 268 | 323 | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 323 | uint64_t in{}; | 270 | 323 | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 323 | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 323 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEN12jsonrpc_fuzz8fuzz_apiELm12ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm6EcEEbPKT1_ Line | Count | Source | 245 | 221 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | 221 | else if constexpr (N == 6) { | 268 | 221 | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | 221 | uint64_t in{}; | 270 | 221 | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | 221 | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 221 | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc110ELc117ELc108ELc108EEEETnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj4EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_E1SELm4EcEEbPKSB_ Line | Count | Source | 245 | 871 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | 871 | else if constexpr (N == 4) { | 286 | 871 | static constexpr auto packed = pack<Str, 4>(); | 287 | 871 | uint32_t in; | 288 | 871 | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | 871 | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 871 | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEENS_3rpc18request_envelope_tELm0ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm8EcEEbPKT1_ Line | Count | Source | 245 | 75.2k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | 75.2k | if constexpr (N == 8) { | 250 | 75.2k | static constexpr auto packed = pack<Str, 8>(); | 251 | 75.2k | uint64_t in; | 252 | 75.2k | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | 75.2k | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 75.2k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEENS_3rpc18request_envelope_tELm1ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm7EcEEbPKT1_ Line | Count | Source | 245 | 65.1k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | 65.1k | else if constexpr (N == 7) { | 259 | 65.1k | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | 65.1k | uint64_t in{}; | 261 | 65.1k | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | 65.1k | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 65.1k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEENS_3rpc18request_envelope_tELm2ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm7EcEEbPKT1_ Line | Count | Source | 245 | 46.5k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | 46.5k | else if constexpr (N == 7) { | 259 | 46.5k | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | 46.5k | uint64_t in{}; | 261 | 46.5k | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | 46.5k | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 46.5k | } |
_ZN3glz10comparitorIL_ZZNS_12decode_indexITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEENS_3rpc18request_envelope_tELm3ERS4_JETkNS_10is_contextERNS_7contextERPKcSA_Qoo14glaze_object_tIT0_E11reflectableISB_EEEvOT2_OT4_OT5_OT6_DpOT3_E15KeyWithEndQuoteELm3EcEEbPKT1_ Line | Count | Source | 245 | 89.1k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | 89.1k | else if constexpr (N == 3) { | 295 | 89.1k | static constexpr auto packed = pack<Str, 2>(); | 296 | 89.1k | uint16_t in; | 297 | 89.1k | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | 89.1k | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 89.1k | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc110ELc117ELc108ELc108EEEETnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcS9_EEvOT1_OT2_T3_E1SELm4EcEEbPKSB_ Line | Count | Source | 245 | 516k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | 516k | else if constexpr (N == 4) { | 286 | 516k | static constexpr auto packed = pack<Str, 4>(); | 287 | 516k | uint32_t in; | 288 | 516k | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | 516k | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 516k | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc117ELc108ELc108EEEETnDaXtlNS_22registry_validate_optsIXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEEEtlS6_Lj10ELb0ELb0ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSB_EEvOT1_OT2_T3_E1SELm3EcEEbPKSD_ Line | Count | Source | 245 | 3.61k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | 3.61k | else if constexpr (N == 3) { | 295 | 3.61k | static constexpr auto packed = pack<Str, 2>(); | 296 | 3.61k | uint16_t in; | 297 | 3.61k | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | 3.61k | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 3.61k | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc97ELc108ELc115ELc101EEEETnDaXtlNS_22registry_validate_optsIXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEEEtlS6_Lj10ELb0ELb0ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSB_EEvOT1_OT2_T3_E1SELm4EcEEbPKSD_ Line | Count | Source | 245 | 7.11k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | 7.11k | else if constexpr (N == 4) { | 286 | 7.11k | static constexpr auto packed = pack<Str, 4>(); | 287 | 7.11k | uint32_t in; | 288 | 7.11k | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | 7.11k | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 7.11k | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc114ELc117ELc101EEEETnDaXtlNS_22registry_validate_optsIXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEEEEtlS6_Lj10ELb0ELb0ELb1ELb1EELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSB_EEvOT1_OT2_T3_E1SELm3EcEEbPKSD_ Line | Count | Source | 245 | 2.43k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | 2.43k | else if constexpr (N == 3) { | 295 | 2.43k | static constexpr auto packed = pack<Str, 2>(); | 296 | 2.43k | uint16_t in; | 297 | 2.43k | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | 2.43k | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 2.43k | } |
_ZN3glz10comparitorIL_ZZZNS_13get_view_jsonITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc47ELc105ELc100EEEETnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEETkNS_10contiguousERNSt3__117basic_string_viewIcNS6_11char_traitsIcEEEEEEDaOT1_ENKUlTnmvE_clILm0EEEDavE3keyELm2EcEEbPKSC_ Line | Count | Source | 245 | 25.1k | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | 25.1k | else if constexpr (N == 2) { | 304 | 25.1k | static constexpr auto packed = pack<Str, 2>(); | 305 | 25.1k | uint16_t in; | 306 | 25.1k | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | 25.1k | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 25.1k | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc117ELc108ELc108EEEETnDaXtlZNS_11parse_valueITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSA_EEDaOT0_OT1_T2_E21opts_validate_skippedtlS6_Lj10ELb0ELb0ELb1ELb1EELb1EEETkNS_10is_contextES8_SB_SA_EEvSF_OSG_T3_E1SELm3EcEEbPKSE_ Line | Count | Source | 245 | 802 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | 802 | else if constexpr (N == 3) { | 295 | 802 | static constexpr auto packed = pack<Str, 2>(); | 296 | 802 | uint16_t in; | 297 | 802 | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | 802 | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 802 | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm5EEEtlA5_cLc97ELc108ELc115ELc101EEEETnDaXtlZNS_11parse_valueITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSA_EEDaOT0_OT1_T2_E21opts_validate_skippedtlS6_Lj10ELb0ELb0ELb1ELb1EELb1EEETkNS_10is_contextES8_SB_SA_EEvSF_OSG_T3_E1SELm4EcEEbPKSE_ Line | Count | Source | 245 | 787 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | 787 | else if constexpr (N == 4) { | 286 | 787 | static constexpr auto packed = pack<Str, 4>(); | 287 | 787 | uint32_t in; | 288 | 787 | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | 787 | return (in == packed); | 293 | | } | 294 | | else if constexpr (N == 3) { | 295 | | static constexpr auto packed = pack<Str, 2>(); | 296 | | uint16_t in; | 297 | | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 787 | } |
_ZN3glz10comparitorIL_ZZNS_5matchITnNS_14string_literalEXtlNS2_ILm4EEEtlA4_cLc114ELc117ELc101EEEETnDaXtlZNS_11parse_valueITnDaXtlNS_4optsELj10ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_7contextERPKcSA_EEDaOT0_OT1_T2_E21opts_validate_skippedtlS6_Lj10ELb0ELb0ELb1ELb1EELb1EEETkNS_10is_contextES8_SB_SA_EEvSF_OSG_T3_E1SELm3EcEEbPKSE_ Line | Count | Source | 245 | 972 | { | 246 | | // pack() builds values in little-endian order (byte 0 in LSB position). | 247 | | // On big-endian systems, memcpy produces native (big-endian) values, | 248 | | // so we need to byteswap to match the packed representation. | 249 | | if constexpr (N == 8) { | 250 | | static constexpr auto packed = pack<Str, 8>(); | 251 | | uint64_t in; | 252 | | std::memcpy(&in, other, 8); | 253 | | if constexpr (std::endian::native == std::endian::big) { | 254 | | in = std::byteswap(in); | 255 | | } | 256 | | return (in == packed); | 257 | | } | 258 | | else if constexpr (N == 7) { | 259 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 260 | | uint64_t in{}; | 261 | | std::memcpy(&in, other, 7); | 262 | | if constexpr (std::endian::native == std::endian::big) { | 263 | | in = std::byteswap(in); | 264 | | } | 265 | | return (in == packed); | 266 | | } | 267 | | else if constexpr (N == 6) { | 268 | | static constexpr auto packed = pack_buffered<Str, 8>(); | 269 | | uint64_t in{}; | 270 | | std::memcpy(&in, other, 6); | 271 | | if constexpr (std::endian::native == std::endian::big) { | 272 | | in = std::byteswap(in); | 273 | | } | 274 | | return (in == packed); | 275 | | } | 276 | | else if constexpr (N == 5) { | 277 | | static constexpr auto packed = pack<Str, 4>(); | 278 | | uint32_t in; | 279 | | std::memcpy(&in, other, 4); | 280 | | if constexpr (std::endian::native == std::endian::big) { | 281 | | in = std::byteswap(in); | 282 | | } | 283 | | return (in == packed) & (Str[4] == other[4]); | 284 | | } | 285 | | else if constexpr (N == 4) { | 286 | | static constexpr auto packed = pack<Str, 4>(); | 287 | | uint32_t in; | 288 | | std::memcpy(&in, other, 4); | 289 | | if constexpr (std::endian::native == std::endian::big) { | 290 | | in = std::byteswap(in); | 291 | | } | 292 | | return (in == packed); | 293 | | } | 294 | 972 | else if constexpr (N == 3) { | 295 | 972 | static constexpr auto packed = pack<Str, 2>(); | 296 | 972 | uint16_t in; | 297 | 972 | std::memcpy(&in, other, 2); | 298 | | if constexpr (std::endian::native == std::endian::big) { | 299 | | in = std::byteswap(in); | 300 | | } | 301 | 972 | return (in == packed) & (Str[2] == other[2]); | 302 | | } | 303 | | else if constexpr (N == 2) { | 304 | | static constexpr auto packed = pack<Str, 2>(); | 305 | | uint16_t in; | 306 | | std::memcpy(&in, other, 2); | 307 | | if constexpr (std::endian::native == std::endian::big) { | 308 | | in = std::byteswap(in); | 309 | | } | 310 | | return (in == packed); | 311 | | } | 312 | | else if constexpr (N == 1) { | 313 | | return Str[0] == other[0]; | 314 | | } | 315 | | else if constexpr (N == 0) { | 316 | | return true; | 317 | | } | 318 | | else { | 319 | | // Clang and GCC optimize this extremely well for constexpr std::string_view | 320 | | // Packing data can create more binary on GCC | 321 | | // The other cases probably aren't needed as compiler explorer shows them optimized equally well as memcmp | 322 | | return 0 == std::memcmp(Str.data(), other, N); | 323 | | } | 324 | 972 | } |
|