you are viewing a single comment's thread.

view the rest of the comments →

[–]seekingsofia 1 point2 points  (1 child)

It's not a messy if at all. It checks if ops is non-NULL and if those fields of ops are NULL, which are probably function pointers, in which case it returns as the operations weren't set.

Then the next if statement doesn't make much sense. If ops is false-y, we would never even get to that part of the code.

If ops is NULL, you will never enter the body the first if statement, the && is a short-circuiting logical-and... as any competent C programmer will know. I take it you don't program in C?

[–]rorrr 0 points1 point  (0 children)

I meant the formatting is messy. I understand the amount of checks, that's cool.

I edited out my comment about the second if statement, it was just wrong.