[PR #83] [CLOSED] RFC: Cleanup case constructs #1044

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

📋 Pull Request Information

Original PR: https://github.com/aaru-dps/Aaru/pull/83
Author: @darkstar
Created: 12/19/2017
Status: Closed

Base: masterHead: cleanups


📝 Commits (1)

  • 10be3c4 Cleanup 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.

## 📋 Pull Request Information **Original PR:** https://github.com/aaru-dps/Aaru/pull/83 **Author:** [@darkstar](https://github.com/darkstar) **Created:** 12/19/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `cleanups` --- ### 📝 Commits (1) - [`10be3c4`](https://github.com/aaru-dps/Aaru/commit/10be3c45947eb4b89c999a494c6f93d8c8b01682) Cleanup huge nested case construct ### 📊 Changes **1 file changed** (+24 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `DiscImageChef.DiscImages/SaveDskF.cs` (+24 -89) </details> ### 📄 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? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:39:54 +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#1044