From d19d328d7b39d3ca3471814c6e23775e81361567 Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Fri, 9 Oct 2015 11:46:54 -0700 Subject: [PATCH] exp/sensor: avoid using naked returns Naked returns must be used for self-documentary reasons. In this unexported package, it is not useful to name return values. The change has been contributed on a previous CL but I don't know what happened, it should have been lost on a bad merge. Change-Id: I6cb9c3a58ad397aeb646f3e57e482628fe31ca31 Reviewed-on: https://go-review.googlesource.com/15658 Reviewed-by: Hyang-Ah Hana Kim --- exp/sensor/android.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exp/sensor/android.go b/exp/sensor/android.go index 2f2655f..7e9ae4d 100644 --- a/exp/sensor/android.go +++ b/exp/sensor/android.go @@ -151,13 +151,13 @@ func disable(t Type) error { return nil } -func readEvents(e []Event) (n int) { +func readEvents(e []Event) int { num := len(e) types := make([]C.int32_t, num) timestamps := make([]C.int64_t, num) vectors := make([]C.float, 3*num) - n = int(C.GoAndroid_readQueue( + n := int(C.GoAndroid_readQueue( C.int(num), (*C.int32_t)(unsafe.Pointer(&types[0])), (*C.int64_t)(unsafe.Pointer(×tamps[0])), @@ -174,7 +174,7 @@ func readEvents(e []Event) (n int) { }, } } - return + return n } // TODO(jbd): Remove destroy?