Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

avoid unnecessary empty strings ("") in favor of clear() and empty() … #468

Merged
merged 1 commit into from
Sep 30, 2015

Conversation

vladon
Copy link
Contributor

@vladon vladon commented Sep 29, 2015

…(performance)

Changed:

  • std::string s = ""; to simply std::string s; (strings are empty when created)
  • if (s == "") to if (s.empty()) and if (s != "") to if (!s.empty()) (avoiding temporary const char *)
  • s = "" to s.clear() (avoid temporary and faster)

@zaphoyd zaphoyd merged commit cd4af12 into zaphoyd:develop Sep 30, 2015
@vladon vladon deleted the unnecessary_empty_strings branch September 30, 2015 14:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants