Closed
Bug 1245868
Opened 8 years ago
Closed 8 years ago
[Static Analysis][Big parameter passed by value] In Functions IsHeadRequest, aRequest is passed by value
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla48
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1346078, CID 1346079)
Attachments
(2 files)
The Static Analysis tool Coverity added that large objects such as CacheRequest and CacheRequestOrVoid are passed by value in: >> bool IsHeadRequest(CacheRequestOrVoid aRequest, CacheQueryParams aParams) and >> bool IsHeadRequest(CacheRequest aRequest, CacheQueryParams aParams) this can be optimized by passing pointer to that object, thus only passing 4 bytes or 32 bit architecture and 8 bytes on 64 bit architecture.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8715866 -
Flags: review?(jst)
Comment 2•8 years ago
|
||
Comment on attachment 8715866 [details] [diff] [review] repalce pass by value with pass by pointer in IsHeadRequest Any reason why passing the value by reference wouldn't be a better option here? It would make the patch much smaller, and it'd ensure you never get null unless someone goes out of their way...
Assignee | ||
Comment 3•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/35227/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/35227/
Attachment #8720174 -
Flags: review?(jst)
Assignee | ||
Updated•8 years ago
|
Attachment #8715866 -
Flags: review?(jst) → review-
Assignee | ||
Comment 4•8 years ago
|
||
Hello Johnny, No reason in particular, is just i'm more biased towards using pointers than references. I've updated the patch accordingly.
Comment 5•8 years ago
|
||
Comment on attachment 8720174 [details] MozReview Request: Bug 1245868 - repalce pass by value with pass by pointer in IsHeadRequest. r?jst https://reviewboard.mozilla.org/r/35227/#review40085 r=jst
Attachment #8720174 -
Flags: review?(jst) → review+
Comment 6•8 years ago
|
||
Apologies for this one falling through the cracks! :(
Comment 8•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f1cfe4b34e8d
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•