Skip to content

Commit

Permalink
dialects: (func) clean up is_declaration [NFC] (#3819)
Browse files Browse the repository at this point in the history
Avoids O(n) len computation.
superlopuh authored Feb 1, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 27bf821 commit 3a9e8b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xdsl/dialects/func.py
Original file line number Diff line number Diff line change
@@ -302,7 +302,7 @@ def is_declaration(self) -> bool:
A helper to identify functions that are external declarations (have an empty
function body)
"""
return len(self.body.blocks) == 0
return not self.body.blocks


@irdl_op_definition

0 comments on commit 3a9e8b3

Please sign in to comment.