Skip to content

Commit

Permalink
Mojo TypeScript bindings: avoid iterating all structs/unions
Browse files Browse the repository at this point in the history
Structs and unions don't contain interface member kinds, so we can
reduce the bindings generation time by not collecting referenced kinds
from these cases.

Change-Id: I8b4a114a97503e045040fd1c911b4e057866ee6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295736
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1111083}
  • Loading branch information
Rebekah Potter authored and Chromium LUCI CQ committed Feb 28, 2023
1 parent 0ac579e commit d895559
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mojo/public/tools/bindings/generators/mojom_ts_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,6 @@ def __init__(self, name, alias):
for method in interface.methods:
referenced_kinds.extend(method.parameters or [])
referenced_kinds.extend(method.response_parameters or [])
for struct in self.module.structs:
referenced_kinds.extend(struct.fields)
for union in self.module.unions:
referenced_kinds.extend(union.fields)

# Determine whether Remote and/or PendingReceiver are referenced.
imports = []
Expand Down

0 comments on commit d895559

Please sign in to comment.