Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-hunhoff committed Mar 1, 2023
1 parent 6663d3e commit 7b9f498
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dncil/cil/body/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(self, reader: CilMethodBodyReaderBase):
self.parse_header(reader)
self.parse_instructions(reader)
self.parse_exception_handlers(reader)
self.parse_basic_blocks()

# use initial offset + method body size to read method body bytes (not the most efficient)
final_pos = reader.tell()
Expand Down Expand Up @@ -79,6 +78,8 @@ def get_exception_handler_bytes(self) -> bytes:
return self.raw_bytes[self.header_size + self.code_size :]

def get_basic_blocks(self) -> Iterator[BasicBlock]:
if not self.basic_blocks:
self.parse_basic_blocks()
yield from self.basic_blocks

def parse_header(self, reader: CilMethodBodyReaderBase):
Expand Down

0 comments on commit 7b9f498

Please sign in to comment.