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

Fix #4706: don't replace ampersands when loading from plain text #4734

Merged
merged 6 commits into from
Jan 29, 2023

Conversation

ZeldaZach
Copy link
Member

Tested by loading in from clipboard

1 Minsc & Boo, Timeless Heroes
1 Fire & Ice

@ebbit1q
Copy link
Member

ebbit1q commented Jan 28, 2023

I think this is the wrong way to go about this, searching the db is one of the most expensive operations the application can do and I'd like to minimise it, instead of always searching the db every single time a replacement is done maybe just don't do the & replacement, perhaps do it after it searches for the name (see db guessCard which also does up to three db searches per card and mangles it a bit).

{{"Aether Adept", 1}, {"Fire // Ice", 2}, {"Pain // Suffering", 3}, {"Forest", 4}},
{{"Aether Adept", 1},
{"Fire // Ice", 2},
{"Minsc & Boo, Timeless Heroes", 1},
Copy link
Member

Choose a reason for hiding this comment

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

these used to go 1234, what have you done zach 🙃

common/decklist.cpp Outdated Show resolved Hide resolved
@ebbit1q ebbit1q changed the title Fix #4706: Exit linting early if a card with the exact name is found Fix #4706: don't replace ampersands when loading from plain text Jan 29, 2023
Copy link
Member

@ebbit1q ebbit1q left a comment

Choose a reason for hiding this comment

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

I like seeing const references, though I am still not sure how impactful they are for qt objects that are always pointers to their data anyway

@ebbit1q ebbit1q merged commit 4c290ae into master Jan 29, 2023
@ebbit1q ebbit1q deleted the fix_4706 branch January 29, 2023 23:37
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.

None yet

2 participants