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

Ignore path_set when equality testing LayerSet #265

Merged
merged 2 commits into from
Jul 15, 2022
Merged

Conversation

madig
Copy link
Collaborator

@madig madig commented Mar 16, 2022

Found this while testing for equality when loading a layer set vs. recreating it manually.

@github-actions
Copy link

🗜 Bloat check ⚖️

Comparing cf645da against b2fb04a

target old size new size difference
target/release/examples/load_save 1.84 MB 1.86 MB 17.77 KB (0.94%)
target/debug/examples/load_save 8.53 MB 8.52 MB -10.46 KB (-0.12%)

@madig
Copy link
Collaborator Author

madig commented Mar 21, 2022

Colin says:

a custom PartialEq impl that ignores pathset would be reasonable"

but I don't know whether this will have observable differences in behavior in some edge cases... Need to check the code.

@cmyr
Copy link
Member

cmyr commented Mar 28, 2022

SO

Colin says:

a custom PartialEq impl that ignores pathset would be reasonable"

but I don't know whether this will have observable differences in behavior in some edge cases... Need to check the code.

So regardless of current behaviour, this comes down to us needing to decide what 'equality' means, in the context of a layer. If a layer is contains exactly the same glyphs as another layer, but has a different path, is it a different layer? (probably yes?)

In any case: to my eye, path_set is an implementation detail, and doesn't seem important to determining equality. All that should matter is equality of name, path, info, and the glyph set? Let me know if you see things differently :)

@madig madig marked this pull request as ready for review July 13, 2022 12:43
@madig madig changed the base branch from make-filenaming-public to master July 13, 2022 15:18
@madig madig changed the title Fill in LayerSet.path_set on load Ignore path_set when equality testing LayerSet Jul 13, 2022
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

I'm curious about some of the stuff in here which seems maybe stale? but over all the fix makes sense!

src/fontinfo.rs Show resolved Hide resolved
@madig
Copy link
Collaborator Author

madig commented Jul 13, 2022

What seems stale to you?

@madig madig merged commit cd8b56d into master Jul 15, 2022
@madig madig deleted the prefill-layerset-paths branch July 15, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants