this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

encoding/openapi: remove unused code

When refactoring cue/load, I noticed that some pieces of code
were unused, which makes it less obvious what kinds of things
can be done. I used `staticcheck` to point out many other
places in the code that are unused.

This is one of those places. I feel it's better to remove this code
even if it might be used in the future (it's always there to be found
in the git history).

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I7a2ee05fcc8a36140e07bea8162f97d0854e26ec
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549295
TryBot-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Unity-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

authored by

Roger Peppe and committed by
Daniel Martí
36645d1b 8868ae6f

-23
-23
encoding/openapi/build.go
··· 44 44 nameFunc func(inst cue.Value, path cue.Path) string 45 45 descFunc func(v cue.Value) string 46 46 fieldFilter *regexp.Regexp 47 - evalDepth int // detect cycles when resolving references 48 47 49 48 schemas *OrderedMap 50 49 ··· 517 516 } 518 517 } 519 518 return a 520 - } 521 - 522 - func countNodes(v cue.Value) (n int) { 523 - switch op, a := v.Expr(); op { 524 - case cue.OrOp, cue.AndOp: 525 - for _, v := range a { 526 - n += countNodes(v) 527 - } 528 - n += len(a) - 1 529 - default: 530 - switch v.Kind() { 531 - case cue.ListKind: 532 - for i, _ := v.List(); i.Next(); { 533 - n += countNodes(i.Value()) 534 - } 535 - case cue.StructKind: 536 - for i, _ := v.Fields(); i.Next(); { 537 - n += countNodes(i.Value()) + 1 538 - } 539 - } 540 - } 541 - return n + 1 542 519 } 543 520 544 521 // isConcrete reports whether v is concrete and not a struct (recursively).