crashreporter_unix_common.cpp: remove useless c_str()
Categories
(Toolkit :: Crash Reporting, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox121 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: qhvp8jxw7, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++])
Attachments
(1 file)
Filling as a good first bug to learn workflows.
Passing the result of c_str() to a function that takes std::string as argument no. 1 is slow and redundant.
https://searchfox.org/mozilla-central/source/toolkit/crashreporter/client/crashreporter_unix_common.cpp#61
https://searchfox.org/mozilla-central/source/toolkit/crashreporter/client/crashreporter_unix_common.cpp#65
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html
| Reporter | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
UIDeleteFile(path); // Pass the string directly is the expected.
Also found that the method UIDeleteFile() which has the return type is "bool" but not used in caller functions. Does adding these lines would be helpful to check whether the deletion was successful or handle any errors?
bool success = UIDeleteFile(path);
if (!success) {
// Handle the error, if needed
}
line # 122 bool UIDeleteFile(const string& file) { return (unlink(file.c_str()) != -1); }
| Reporter | ||
Comment 2•2 years ago
|
||
dunno but this isn't what this bug is about :)
please open a separate issue about it
Comment 3•2 years ago
|
||
Regarding return value discussion, Opened a new issue here: https://bugzilla.mozilla.org/show_bug.cgi?id=1856273
How do I go about getting this ticket assigned to me?
| Reporter | ||
Comment 5•2 years ago
|
||
please submit a patch and it will be done automatically
Updated•2 years ago
|
Comment 8•2 years ago
|
||
| bugherder | ||
Updated•2 years ago
|
Description
•