-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
lldb/source/Breakpoint/BreakpointIDList.cpp:262: Prefer const reference for range variables #91220
Labels
Comments
@llvm/issue-subscribers-lldb Author: None (dcb314)
Static analyser cppcheck says:
lldb/source/Breakpoint/BreakpointIDList.cpp:262:26: performance: Range variable 'name' should be declared as const reference. [iterateByValue] Source code is
|
xgupta
added a commit
to xgupta/llvm-project
that referenced
this issue
Jun 8, 2024
… (NFC) Cppcheck recommends using a const reference for range variables in a for-each loop. This avoids unnecessary copying of elements, improving performance. Caught by cppcheck - lldb/source/API/SBBreakpoint.cpp:717:22: performance: Range variable 'name' should be declared as const reference. [iterateByValue] lldb/source/API/SBTarget.cpp:1150:15: performance: Range variable 'name' should be declared as const reference. [iterateByValue] lldb/source/Breakpoint/Breakpoint.cpp:888:26: performance: Range variable 'name' should be declared as const reference. [iterateByValue] lldb/source/Breakpoint/BreakpointIDList.cpp:262:26: performance: Range variable 'name' should be declared as const reference. [iterateByValue] Fix llvm#91213 Fix llvm#91217 Fix llvm#91219 Fix llvm#91220
nekoshirro
pushed a commit
to nekoshirro/Alchemist-LLVM
that referenced
this issue
Jun 9, 2024
… (NFC) (llvm#94840) Cppcheck recommends using a const reference for range variables in a for-each loop. This avoids unnecessary copying of elements, improving performance. Caught by cppcheck - lldb/source/API/SBBreakpoint.cpp:717:22: performance: Range variable 'name' should be declared as const reference. [iterateByValue] lldb/source/API/SBTarget.cpp:1150:15: performance: Range variable 'name' should be declared as const reference. [iterateByValue] lldb/source/Breakpoint/Breakpoint.cpp:888:26: performance: Range variable 'name' should be declared as const reference. [iterateByValue] lldb/source/Breakpoint/BreakpointIDList.cpp:262:26: performance: Range variable 'name' should be declared as const reference. [iterateByValue] Fix llvm#91213 Fix llvm#91217 Fix llvm#91219 Fix llvm#91220 Signed-off-by: Hafidz Muzakky <ais.muzakky@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Static analyser cppcheck says:
lldb/source/Breakpoint/BreakpointIDList.cpp:262:26: performance: Range variable 'name' should be declared as const reference. [iterateByValue]
Source code is
The text was updated successfully, but these errors were encountered: