this repo has no description
0
fork

Configure Feed

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

all: replace cue.Value.Null with IsNull when we just need a bool

Null returns a full error when a cue.Value is not a null,
which allocates unnecessarily when the caller just needs to have
the boolean rather than the full error when it's not a null.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I5940530257b3fddfa51b97cfdbf5daf018604e87
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1227396
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+2 -2
+1 -1
encoding/openapi/build.go
··· 489 489 490 490 for _, v := range a { 491 491 switch { 492 - case v.Null() == nil: 492 + case v.IsNull(): 493 493 // TODO: for JSON schema, we need to fall through. 494 494 nullable = true 495 495
+1 -1
pkg/tool/exec/exec.go
··· 46 46 // TODO: set environment variables, if defined. 47 47 stream := func(name string) (stream cue.Value, ok bool) { 48 48 c := ctx.Obj.LookupPath(cue.ParsePath(name)) 49 - if err := c.Null(); c.Err() != nil || err == nil { 49 + if c.Err() != nil || c.IsNull() { 50 50 return 51 51 } 52 52 return c, true