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 <hyangah@gmail.com>
This commit is contained in:
Родитель
83be1bf497
Коммит
d19d328d7b
|
@ -151,13 +151,13 @@ func disable(t Type) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func readEvents(e []Event) (n int) {
|
func readEvents(e []Event) int {
|
||||||
num := len(e)
|
num := len(e)
|
||||||
types := make([]C.int32_t, num)
|
types := make([]C.int32_t, num)
|
||||||
timestamps := make([]C.int64_t, num)
|
timestamps := make([]C.int64_t, num)
|
||||||
vectors := make([]C.float, 3*num)
|
vectors := make([]C.float, 3*num)
|
||||||
|
|
||||||
n = int(C.GoAndroid_readQueue(
|
n := int(C.GoAndroid_readQueue(
|
||||||
C.int(num),
|
C.int(num),
|
||||||
(*C.int32_t)(unsafe.Pointer(&types[0])),
|
(*C.int32_t)(unsafe.Pointer(&types[0])),
|
||||||
(*C.int64_t)(unsafe.Pointer(×tamps[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?
|
// TODO(jbd): Remove destroy?
|
||||||
|
|
Загрузка…
Ссылка в новой задаче