Closed Bug 1622166 Opened 5 years ago Closed 4 years ago

Consider using C++17 fold expressions to implement variadic Read/WriteParams()

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: mozbugz, Assigned: nikopacheco22)

Details

Attachments

(1 file, 1 obsolete file)

While passing by, I noticed:
https://searchfox.org/mozilla-central/source/ipc/glue/IPCMessageUtils.h#1265-1283

Variadic functions WriteParams and ReadParams are written in the old recursive way: Handle first arg, recurse with the rest.

I think they could benefit from C++17 fold expressions, e.g.:

template <typename... Ts>
static void WriteParams(Message* aMsg, const Ts&... aArgs) {
  (WriteParam(aMsg, aArgs), ...);
}

(There may be other places like this in IPC-land? I don't know.)

Priority: -- → P3
Assignee: nobody → nikopacheco22
Status: NEW → ASSIGNED
Attachment #9139572 - Attachment description: Bug 1622166 - Change varidic functions from de old recursive way using Fold expressions r?gerald → Bug 1622166 - Change variadic functions from the old recursive way using Fold expressions r?gerald
Attachment #9139653 - Attachment is obsolete: true

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:nikopacheco22, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(nikopacheco22)

Looks like the assignee Nicolas is a relatively new bugzilla user (welcome, & thanks for the patch!)

jld, perhaps you could trigger lando and/or help Nicolas with checkin-needed, if you're still comfortable with the patch landing?

Flags: needinfo?(jld)

(In reply to Daniel Holbert [:dholbert] from comment #4)

Looks like the assignee Nicolas is a relatively new bugzilla user (welcome, & thanks for the patch!)

jld, perhaps you could trigger lando and/or help Nicolas with checkin-needed, if you're still comfortable with the patch landing?

yey, I am new and I am still learning! The bug was accepted and marked as ready to land here https://phabricator.services.mozilla.com/D70431,but I don't know how to continue.

Flags: needinfo?(nikopacheco22)
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0acaafa3f924 Change variadic functions from the old recursive way using Fold expressions r=gerald,jld
Flags: needinfo?(jld)

Looks like your nfroyd landed your patch - hooray!

For your next patch -- once it's gotten review and is ready to land, you can add the Check-in Needed tag on phabricator, as described at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch#Getting_the_patch_checked_into_the_tree , and someone will come along within a day or so and land the patch for you (after a sanity-check that it has indeed been reviewed).

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: