Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <andres@planetscale.com>
  • Loading branch information
systay committed Feb 10, 2025
1 parent 673262e commit d0bc070
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 82 deletions.
12 changes: 6 additions & 6 deletions go/tools/asthelpergen/integration/ast_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go/tools/asthelpergen/rewrite_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,14 @@ func (r *rewriteGen) rewriteChildSlice(t, field types.Type, fieldName string, pa

// if a.collectPaths {
// if x == 0 {
// a.cur.current.AddStepWithSliceIndex(LeafSliceOffset, x)
// a.cur.current.AddStepWithOffset(LeafSliceOffset)
// } else {
// a.cur.current.ChangeOffset(x)
// }
// }
savePath := jen.If(jen.Id("a.collectPaths")).Block(
jen.If(jen.Id("x").Op("==").Lit(0)).Block(
jen.Id("a.cur.current.AddStepWithOffset").Params(jen.Id("uint16").Params(jen.Id(printableTypeName(t)+fieldName+"Offset")), jen.Id("x")),
jen.Id("a.cur.current.AddStepWithOffset").Params(jen.Id("uint16").Params(jen.Id(printableTypeName(t) + fieldName + "Offset"))),
).Else().Block(
jen.Id("a.cur.current.ChangeOffset").Params(jen.Id("x")),
),
Expand Down
Loading

0 comments on commit d0bc070

Please sign in to comment.