Closed Bug 1245868 Opened 6 years ago Closed 6 years ago
[Static Analysis][Big parameter passed by value] In Functions Is
Head Request, a Request is passed by value
4.81 KB, patch
|Details | Diff | Splinter Review|
58 bytes, text/x-review-board-request
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...
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)
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! :(
You need to log in before you can comment on or make changes to this bug.