mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-02-04 09:04:35 +00:00
[PR #83] RFC: Cleanup case constructs #1049
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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?