Skip to content
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

Try to combine AvaloniaResources with the same system path #15302

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

maxkatz6
Copy link
Member

What does the pull request do?

Follow-up PR/optimization after previous PR.
If the same file was included multiple times, but with different path/link, we should try to combine them into a single resource with aliases.

How was the solution implemented (if it's not obvious)?

No changes to the protocol. Just adjust offset properties for duplicated indexes, and don't write the same data twice.

Checklist

Comment on lines +70 to 71
[Obsolete]
public static void WriteResources(Stream output, List<(string Path, int Size, Func<Stream> Open)> resources)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this method is part of public API, I made it obsolete, and added a new overload with AvaloniaResourcesEntry items.

@kekekeks kekekeks enabled auto-merge April 10, 2024 05:59
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0047122-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@kekekeks kekekeks added this pull request to the merge queue Apr 10, 2024
Merged via the queue into master with commit b5db6bb Apr 10, 2024
11 checks passed
@kekekeks kekekeks deleted the combine-same-file-resources branch April 10, 2024 08:07
@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label Apr 20, 2024
maxkatz6 added a commit that referenced this pull request Apr 20, 2024
* Try to combine AvaloniaResources with the same system path

* Fix test assert
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants