Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clang tidy#1286

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
uqs wants to merge4 commits intoOpenXcom:master
base:master
Choose a base branch
Loading
fromuqs:clang-tidy
Open

Clang tidy#1286

uqs wants to merge4 commits intoOpenXcom:masterfromuqs:clang-tidy

Conversation

@uqs
Copy link
Contributor

@uqsuqs commentedNov 27, 2020

Various clang-tidy inspired cleanups, they shrink the binary size by about 4k :)

They should speed things up as the Position ctor will be called less often.

I'm a bit surprised about the float math though, sure on a i386 it was faster than double math, but these days?

This is in addition to generating Makefiles or Ninja files. It can beused by various LLVM tooling like clang-tidy or YouCompleteMe
Ran: clang-tidy -p . -header-filter=".*" "-checks=-*,performance-inefficient-string-concatenation" -fix **/*.cppTo solve: warning: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation]
floor(3) as used previously is the libc floor, which takes a doublealways, so the cast to float is superfluous. floorf(3) would take afloat argument, but instead of switching to that, use std::floor whichhas the proper overload for double/float, and as of C++11 also has onefor integral types, so use that directly.The clang-tidy fixes were massaged manually, as it wasn't quite assmart.
The fixes that added std::move (C++11 only) were manually revertedagain. This sprinkles a ton of const refs all over the place, obviatingthe need to copy-construct Position all the time.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@uqs

[8]ページ先頭

©2009-2025 Movatter.jp