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

Coverity Bug: repodlgs_common.cpp: 181 in sell_all_improvements() #2488

Closed
jwrober opened this issue Jan 6, 2025 · 0 comments · Fixed by #2489
Closed

Coverity Bug: repodlgs_common.cpp: 181 in sell_all_improvements() #2488

jwrober opened this issue Jan 6, 2025 · 0 comments · Fixed by #2489
Labels
bug Something isn't working Untriaged This issue or PR needs triaging

Comments

@jwrober
Copy link
Collaborator

jwrober commented Jan 6, 2025

Describe the bug
1 new defect(s) introduced to longturn/freeciv21 found with Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 1587153: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/client/repodlgs_common.cpp: 181 in sell_all_improvements(const impr_type *, bool, char *, unsigned long)()

________________________________________________________________________________________________________
*** CID 1587153:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/client/repodlgs_common.cpp: 181 in sell_all_improvements(const impr_type *, bool, char *, unsigned long)()
175       city_list_iterate(client.conn.playing->cities, pcity)
176       {
177         cities.append(pcity);
178       }
179       city_list_iterate_end;
180     
>>>     CID 1587153:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "cities" is passed-by-value as parameter to "sell_all_improvements_for_cities" when it could be moved instead.
181       sell_all_improvements_for_cities(cities, pimprove, redundant_only, message,
182                                        message_sz);
183     }
184     
185     /**
186        Sell all improvements of the given type in cities.  If

Additional context
Seems to be from this recent change: #2484

@jwrober jwrober added bug Something isn't working Untriaged This issue or PR needs triaging labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Untriaged This issue or PR needs triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant