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

#161: Use QString::fromStdString(x) instead of QString{x.c_str()} #162

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

aaronhktan
Copy link
Owner

@aaronhktan aaronhktan commented Mar 7, 2024

Description

  • Using QString::fromStdString() should be a little bit more efficient when converting from an std::string to a QString. (See here.)
  • Also replaces an instance of const std::string & with std::string_view.

Part of improvements as part of #161.

Type of change

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

How Has This Been Tested?

Tested on macOS.

Checklist:

  • My code follows the style guidelines of this project (black for Python
    code, .clang-format in the src/jyut-dict directory for C++)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have translated my user-facing strings to all currently-supported languages
  • I have made corresponding changes to the documentation

- This should be a little bit more efficient when converting from an std::string to a QString.
- Also replaces an instance of const std::string & with std::string_view.
@aaronhktan aaronhktan added the enhancement Improvement to existing feature label Mar 7, 2024
@aaronhktan aaronhktan added this to the 2024 Milestone 1 milestone Mar 7, 2024
@aaronhktan aaronhktan self-assigned this Mar 7, 2024
@aaronhktan aaronhktan changed the title #161: Use QString::fromStdString() instead of QString{x.c_str()} #161: Use QString::fromStdString(x) instead of QString{x.c_str()} Mar 8, 2024
@aaronhktan aaronhktan merged commit 63c87be into main Mar 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant