Closed Bug 1245868 Opened 6 years ago Closed 6 years ago

[Static Analysis][Big parameter passed by value] In Functions IsHeadRequest, aRequest is passed by value

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox47 --- affected
firefox48 --- fixed

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.
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...
Attachment #8715866 - Flags: review?(jst) → review-
Hello Johnny,

No reason in particular, is just i'm more biased towards using pointers than references. I've updated the patch accordingly.
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+
Apologies for this one falling through the cracks! :(
https://hg.mozilla.org/mozilla-central/rev/f1cfe4b34e8d
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.