Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticHeader::setup presents numeorus opportunities for procedure extraction #1586

Closed
mulkieran opened this issue Jul 16, 2019 · 4 comments · Fixed by #1589
Closed

StaticHeader::setup presents numeorus opportunities for procedure extraction #1586

mulkieran opened this issue Jul 16, 2019 · 4 comments · Fixed by #1589
Assignees
Labels
sub-issue issue that has a parent

Comments

@mulkieran
Copy link
Member

mulkieran commented Jul 16, 2019

Basically, all actions taken are symmetric. So, if sigblock 1 read reaches state A and sigblock 2 read reaches state B, then the same action is performed as if sigblock 2 read reached state A and sigblock 1 read reached state B, except that the roles are switched. It makes sense to use one function for these identical actions, rather than two distinct blocks of code.

@mulkieran
Copy link
Member Author

Currently blocked by #1585, but that's a simple one and should go in fast.

@mulkieran
Copy link
Member Author

@GuillaumeGomez Some of the work under this issue was already begun in #1562. If you could, please do this work refactoring separately. It should make it easier to conclude #1562.

@mulkieran
Copy link
Member Author

unblocked now.

@mulkieran
Copy link
Member Author

I think it might make sense to work from the outside inward.

So the outermost 2-by-2 table represents the result of calling StaticHeader::read and looks like:

            Ok        |        Err
Ok  |                 |          x
----------------------------------------------
Err |        x        |

The two quadrants marked x are identical except for switched roles, so one function should do for both. They match up with the blocks starting at 397 and 412.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sub-issue issue that has a parent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants