Pass by reference instead of pointer
When the parameters are assumed to be non-null, they should be passed by
reference instead of by pointer.
Bug: 239182977
Test: atest inputflinger_tests
Change-Id: Ifd21a87020f2e9056b3a233ddd33d3f3440b94ee
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.h b/services/inputflinger/reader/mapper/TouchInputMapper.h
index 7b8f6a1..3cb11aa 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.h
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.h
@@ -291,15 +291,15 @@
CoverageCalibration coverageCalibration;
- inline void applySizeScaleAndBias(float* outSize) const {
+ inline void applySizeScaleAndBias(float& outSize) const {
if (sizeScale) {
- *outSize *= *sizeScale;
+ outSize *= *sizeScale;
}
if (sizeBias) {
- *outSize += *sizeBias;
+ outSize += *sizeBias;
}
- if (*outSize < 0) {
- *outSize = 0;
+ if (outSize < 0) {
+ outSize = 0;
}
}
} mCalibration;