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

Replace HashMap<String, String> with HashMap<&str, &str> to reduce allocation #200

Merged
merged 11 commits into from
Apr 19, 2021

Conversation

ramsayleung
Copy link
Owner

Description

Try to fix #127 and #160 , use HashMap<&str, &str> instead of HashMap<String, String> to avoid so many to_string and to_owned.

Motivation and Context

Reduce uncessary allocation.

Dependencies

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

All existing tests pass

Copy link
Collaborator

@marioortizmanero marioortizmanero left a comment

Choose a reason for hiding this comment

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

Yes, I really wanted this! Great job.

Cargo.toml Outdated Show resolved Hide resolved
src/model/enums/country.rs Outdated Show resolved Hide resolved
@marioortizmanero marioortizmanero merged commit 1006ffc into master Apr 19, 2021
@marioortizmanero marioortizmanero deleted the ramsay_reduce_allocation branch April 19, 2021 14:36
@ramsayleung ramsayleung mentioned this pull request Apr 20, 2021
87 tasks
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.

Meta-Issue
2 participants