-
Notifications
You must be signed in to change notification settings - Fork 43
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
Migrate to Trees 2.0 #826
Migrate to Trees 2.0 #826
Conversation
…uld not have passed
Note that CI might fail due to |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #826 +/- ##
==========================================
+ Coverage 61.53% 61.59% +0.05%
==========================================
Files 618 618
Lines 19083 19054 -29
Branches 1396 1406 +10
==========================================
- Hits 11743 11736 -7
+ Misses 6994 6977 -17
+ Partials 346 341 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -70,7 +71,7 @@ public AdvancedManualInstallerUI(IServiceProvider provider) | |||
|
|||
private async Task<(bool shouldInstall, DeploymentData data)> GetDeploymentDataAsync( | |||
GameInstallation gameInstallation, string modName, | |||
FileTreeNode<RelativePath, ModSourceFileEntry> archiveFiles) | |||
KeyedBox<RelativePath, ModFileTree> archiveFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a quick look through,
since we use KeyedBox<RelativePath, ModFileTree>
a lot, can we make a type alias for it that is shorter and either has Node or Tree in the name?
I think something simple like RelativeModFileTree
works. To improve readability and shorten it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this, I had to dig through the path library to find out what KeyedBox was, it turns out it's a wrapper for TVal
with an additional TKey
typed tag, the Key isn't passed along with the box, just the type of the Key. We might want to find a better name for these in the mainline parts of the application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to suggestions personally.
Heck, even ModFileTreeNode
works for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead with ModFileTreeNode
. We can change it later if we come up with a better name.
Aside from the KeyedBox comment this all looks solid |
This migrates our existing tree code to the new, efficient 'create your own tree' system.
General Changes
ModFileTree
) containing only the tree info needed by our DataModel..AllSatisfy
throughout our codebase.main
branch.Observations
Other Notes
There are still opportunities for perf gains, for instance the
GetFiles().Select
pattern in some places can be replaced withGetChildrenRecursive
with customTFilter
andTSelector
, at expense of a few extra LoC. For now I've refrained from rewriting those to keep the code simple, but if additional speedup is required, the possibilities are still there.I just didn't consider them to be significant enough perf improvements to be worth implementing in place of readability; as the impact on UX would be negligible. (Gains are limited by
IEnumerable
return type onModInstallerResult
)Reviewer
@halgari - Self requested during meeting.