mos_8502 :verified: on Nostr: My favourite thing to do in C that pisses people off is using the Elvis operator (the ...
My favourite thing to do in C that pisses people off is using the Elvis operator (the two operand variant of the ternary conditional) to ensure a variable is non-NULL before using it.
MyOpaqueType p = my_opaque_type_new() ?: MyOpaqueTypeDefaultInstance;
Published at
2024-08-29 17:22:39Event JSON
{
"id": "cf0d9d63ad9bc5dbdd18f464020867aa35bf7b3c65b32f50324d4a589f0b1831",
"pubkey": "04f8915424c713657ad6ce59443d28dbdcf5832687c9af560ae388f59276a137",
"created_at": 1724952159,
"kind": 1,
"tags": [
[
"proxy",
"https://studio8502.ca/@mos_8502/113046464719752567",
"web"
],
[
"proxy",
"https://studio8502.ca/users/mos_8502/statuses/113046464719752567",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://studio8502.ca/users/mos_8502/statuses/113046464719752567",
"pink.momostr"
],
[
"-"
]
],
"content": "My favourite thing to do in C that pisses people off is using the Elvis operator (the two operand variant of the ternary conditional) to ensure a variable is non-NULL before using it. \n\nMyOpaqueType p = my_opaque_type_new() ?: MyOpaqueTypeDefaultInstance;",
"sig": "c8af2e29de52f112fb3d3437d56f307c8cc1361650803b7ff615e842a89c10d4cf763486d562e5ca005056111f051f0994f69f0ffe14487c91e518c918ffeec5"
}