diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2018-11-02 15:18:43 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-11-02 22:47:58 +0000 |
| commit | 3813edf26edb78620632dc9c7d66096e5b2b5019 (patch) | |
| tree | 7b61738f970909800472f3ab5d00e90ddd0d405e /src/runtime | |
| parent | e25823edcea364df70b8db7462f53e7dac2b8fca (diff) | |
| download | go-3813edf26edb78620632dc9c7d66096e5b2b5019.tar.xz | |
all: use "reports whether" consistently in the few places that didn't
Go documentation style for boolean funcs is to say:
// Foo reports whether ...
func Foo() bool
(rather than "returns true if")
This CL also replaces 4 uses of "iff" with the same "reports whether"
wording, which doesn't lose any meaning, and will prevent people from
sending typo fixes when they don't realize it's "if and only if". In
the past I think we've had the typo CLs updated to just say "reports
whether". So do them all at once.
(Inspired by the addition of another "returns true if" in CL 146938
in fd_plan9.go)
Created with:
$ perl -i -npe 's/returns true if/reports whether/' $(git grep -l "returns true iff" | grep -v vendor)
$ perl -i -npe 's/returns true if/reports whether/' $(git grep -l "returns true if" | grep -v vendor)
Change-Id: Ided502237f5ab0d25cb625dbab12529c361a8b9f
Reviewed-on: https://go-review.googlesource.com/c/147037
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/mbitmap.go | 2 | ||||
| -rw-r--r-- | src/runtime/mcentral.go | 2 | ||||
| -rw-r--r-- | src/runtime/mgc.go | 6 | ||||
| -rw-r--r-- | src/runtime/mgcwork.go | 4 | ||||
| -rw-r--r-- | src/runtime/mwbbuf.go | 2 | ||||
| -rw-r--r-- | src/runtime/netpoll.go | 2 | ||||
| -rw-r--r-- | src/runtime/panic.go | 4 | ||||
| -rw-r--r-- | src/runtime/pprof/internal/profile/profile.go | 2 | ||||
| -rw-r--r-- | src/runtime/proc.go | 8 | ||||
| -rw-r--r-- | src/runtime/signal_windows.go | 2 |
10 files changed, 17 insertions, 17 deletions
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index 4854c0e632..67d99900a2 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -517,7 +517,7 @@ func (h heapBits) bits() uint32 { return uint32(*h.bitp) >> (h.shift & 31) } -// morePointers returns true if this word and all remaining words in this object +// morePointers reports whether this word and all remaining words in this object // are scalars. // h must not describe the second word of the object. func (h heapBits) morePointers() bool { diff --git a/src/runtime/mcentral.go b/src/runtime/mcentral.go index d9bc8b4719..f108bfc31e 100644 --- a/src/runtime/mcentral.go +++ b/src/runtime/mcentral.go @@ -203,7 +203,7 @@ func (c *mcentral) uncacheSpan(s *mspan) { // and, based on the number of free objects in s, // moves s to the appropriate list of c or returns it // to the heap. -// freeSpan returns true if s was returned to the heap. +// freeSpan reports whether s was returned to the heap. // If preserve=true, it does not move s (the caller // must take care of it). func (c *mcentral) freeSpan(s *mspan, preserve bool, wasempty bool) bool { diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index e12df7f7d2..f4646db67a 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -735,7 +735,7 @@ func (c *gcControllerState) findRunnableGCWorker(_p_ *p) *g { return gp } -// pollFractionalWorkerExit returns true if a fractional mark worker +// pollFractionalWorkerExit reports whether a fractional mark worker // should self-preempt. It assumes it is called from the fractional // worker. func pollFractionalWorkerExit() bool { @@ -1157,7 +1157,7 @@ const ( gcTriggerCycle ) -// test returns true if the trigger condition is satisfied, meaning +// test reports whether the trigger condition is satisfied, meaning // that the exit condition for the _GCoff phase has been met. The exit // condition should be tested when allocating. func (t gcTrigger) test() bool { @@ -1867,7 +1867,7 @@ func gcBgMarkWorker(_p_ *p) { } } -// gcMarkWorkAvailable returns true if executing a mark worker +// gcMarkWorkAvailable reports whether executing a mark worker // on p is potentially useful. p may be nil, in which case it only // checks the global sources of work. func gcMarkWorkAvailable(p *p) bool { diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index c32c5eddd7..f2f20fcdac 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -138,7 +138,7 @@ func (w *gcWork) put(obj uintptr) { } } -// putFast does a put and returns true if it can be done quickly +// putFast does a put and reports whether it can be done quickly // otherwise it returns false and the caller needs to call put. //go:nowritebarrierrec func (w *gcWork) putFast(obj uintptr) bool { @@ -299,7 +299,7 @@ func (w *gcWork) balance() { } } -// empty returns true if w has no mark work available. +// empty reports whether w has no mark work available. //go:nowritebarrierrec func (w *gcWork) empty() bool { return w.wbuf1 == nil || (w.wbuf1.nobj == 0 && w.wbuf2.nobj == 0) diff --git a/src/runtime/mwbbuf.go b/src/runtime/mwbbuf.go index f35f7286ac..c91cea254e 100644 --- a/src/runtime/mwbbuf.go +++ b/src/runtime/mwbbuf.go @@ -107,7 +107,7 @@ func (b *wbBuf) discard() { b.next = uintptr(unsafe.Pointer(&b.buf[0])) } -// empty returns true if b contains no pointers. +// empty reports whether b contains no pointers. func (b *wbBuf) empty() bool { return b.next == uintptr(unsafe.Pointer(&b.buf[0])) } diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go index 75db8c6c2f..71ca993cc0 100644 --- a/src/runtime/netpoll.go +++ b/src/runtime/netpoll.go @@ -95,7 +95,7 @@ func netpollinited() bool { //go:linkname poll_runtime_isPollServerDescriptor internal/poll.runtime_isPollServerDescriptor -// poll_runtime_isPollServerDescriptor returns true if fd is a +// poll_runtime_isPollServerDescriptor reports whether fd is a // descriptor being used by netpoll. func poll_runtime_isPollServerDescriptor(fd uintptr) bool { fds := netpolldescriptor() diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 45be886196..5b989d28e9 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -849,7 +849,7 @@ func canpanic(gp *g) bool { return true } -// shouldPushSigpanic returns true if pc should be used as sigpanic's +// shouldPushSigpanic reports whether pc should be used as sigpanic's // return PC (pushing a frame for the call). Otherwise, it should be // left alone so that LR is used as sigpanic's return PC, effectively // replacing the top-most frame with sigpanic. This is used by @@ -887,7 +887,7 @@ func shouldPushSigpanic(gp *g, pc, lr uintptr) bool { return true } -// isAbortPC returns true if pc is the program counter at which +// isAbortPC reports whether pc is the program counter at which // runtime.abort raises a signal. // // It is nosplit because it's part of the isgoexception diff --git a/src/runtime/pprof/internal/profile/profile.go b/src/runtime/pprof/internal/profile/profile.go index 84e607e9a8..a6f8354b1e 100644 --- a/src/runtime/pprof/internal/profile/profile.go +++ b/src/runtime/pprof/internal/profile/profile.go @@ -573,7 +573,7 @@ func (p *Profile) Demangle(d Demangler) error { return nil } -// Empty returns true if the profile contains no samples. +// Empty reports whether the profile contains no samples. func (p *Profile) Empty() bool { return len(p.Sample) == 0 } diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 542cf1ed70..864efcdfed 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2400,7 +2400,7 @@ stop: goto top } -// pollWork returns true if there is non-background work this P could +// pollWork reports whether there is non-background work this P could // be doing. This is a fairly lightweight check to be used for // background work loops, like idle GC. It checks a subset of the // conditions checked by the actual scheduler. @@ -4713,7 +4713,7 @@ func pidleget() *p { return _p_ } -// runqempty returns true if _p_ has no Gs on its local run queue. +// runqempty reports whether _p_ has no Gs on its local run queue. // It never returns true spuriously. func runqempty(_p_ *p) bool { // Defend against a race where 1) _p_ has G1 in runqnext but runqhead == runqtail, @@ -4934,7 +4934,7 @@ type gQueue struct { tail guintptr } -// empty returns true if q is empty. +// empty reports whether q is empty. func (q *gQueue) empty() bool { return q.head == 0 } @@ -5000,7 +5000,7 @@ type gList struct { head guintptr } -// empty returns true if l is empty. +// empty reports whether l is empty. func (l *gList) empty() bool { return l.head == 0 } diff --git a/src/runtime/signal_windows.go b/src/runtime/signal_windows.go index 873ce66abe..e8a64da657 100644 --- a/src/runtime/signal_windows.go +++ b/src/runtime/signal_windows.go @@ -38,7 +38,7 @@ func initExceptionHandler() { } } -// isgoexception returns true if this exception should be translated +// isgoexception reports whether this exception should be translated // into a Go panic. // // It is nosplit to avoid growing the stack in case we're aborting |
