mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-02-04 00:54:33 +00:00
[PR #83] [CLOSED] RFC: Cleanup case constructs #1044
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?
📋 Pull Request Information
Original PR: https://github.com/aaru-dps/Aaru/pull/83
Author: @darkstar
Created: 12/19/2017
Status: ❌ Closed
Base:
master← Head:cleanups📝 Commits (1)
10be3c4Cleanup huge nested case construct📊 Changes
1 file changed (+24 additions, -89 deletions)
View changed files
📝
DiscImageChef.DiscImages/SaveDskF.cs(+24 -89)📄 Description
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?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.