make the logic for cxxTypeNeedsMove more straightforward; r=Alex_Gaynor

RESOLVED FIXED in Firefox 66

Status

()

enhancement
RESOLVED FIXED
4 months ago
4 months ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla66
Points:
---

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 months ago

I started with this to implement move Recv, but thought I might as well try to
land this while move Recv waits for other things.

(Assignee)

Comment 1

4 months ago
Nested conditionals are hard to read; separating things out should make
the flow somewhat more obvious.
Attachment #9038884 - Flags: review?(agaynor)
Comment on attachment 9038884 [details] [diff] [review]
make the logic for cxxTypeNeedsMove more straightforward; r=Alex_Gaynor

Review of attachment 9038884 [details] [diff] [review]:
-----------------------------------------------------------------

One potential cleanup, LGTM otherwise.

::: ipc/ipdl/ipdl/lower.py
@@ +572,5 @@
> +
> +    if ipdltype.isCxx():
> +        return ipdltype.isMoveonly()
> +
> +    if not ipdltype.isIPDL():

I think it might be slightly cleaner to express this as:

```
if isIPDL():
   return isArray() or isShmem() ...

return False
```

WDYT?
Attachment #9038884 - Flags: review?(agaynor) → review+
(Assignee)

Comment 3

4 months ago

(In reply to Alex Gaynor [:Alex_Gaynor] from comment #2)

Comment on attachment 9038884 [details] [diff] [review]
make the logic for cxxTypeNeedsMove more straightforward; r=Alex_Gaynor

Review of attachment 9038884 [details] [diff] [review]:

One potential cleanup, LGTM otherwise.

::: ipc/ipdl/ipdl/lower.py
@@ +572,5 @@

  • if ipdltype.isCxx():
  •    return ipdltype.isMoveonly()
    
  • if not ipdltype.isIPDL():

I think it might be slightly cleaner to express this as:

if isIPDL():
   return isArray() or isShmem() ...

return False

WDYT?

I was aiming for early-exits as much as possible, but perhaps the positive logic is easier to read in this case? Let's just go with the positive logic.

Comment 4

4 months ago
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a3b8503e6109
make the logic for cxxTypeNeedsMove more straightforward; r=Alex_Gaynor

Comment 5

4 months ago
bugherder
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.