[PR #83] RFC: Cleanup case constructs #1049

Open
opened 2026-01-29 15:39:58 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/aaru-dps/Aaru/pull/83

State: closed
Merged: No


Question: would you be willing to accept cleanups of those huge switch constructs in a form like this? I could go through the source and do it if you want.

These are in some source files and are very hard to follow. IMHO a table-driven structure like what I did here is more maintainable.

OTOH, since this pattern repeats in a few source files, would it make sense to have a generic helper function that translates (cylinders,heads,sectors-per-track,sector-size)->MediaType and maybe (filesize)->MediaType?

**Original Pull Request:** https://github.com/aaru-dps/Aaru/pull/83 **State:** closed **Merged:** No --- Question: would you be willing to accept cleanups of those huge switch constructs in a form like this? I could go through the source and do it if you want. These are in some source files and are very hard to follow. IMHO a table-driven structure like what I did here is more maintainable. OTOH, since this pattern repeats in a few source files, would it make sense to have a generic helper function that translates (cylinders,heads,sectors-per-track,sector-size)->MediaType and maybe (filesize)->MediaType?
claunia added the pull-request label 2026-01-29 15:39:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/Aaru-aaru-dps#1049