diff options
author | John Chang <cweichun@google.com> | 2023-11-05 22:06:27 +0000 |
---|---|---|
committer | John Chang <cweichun@google.com> | 2023-11-29 02:16:24 +0000 |
commit | 4257b599e3848d50e0cfe77fa80c0066b5394708 (patch) | |
tree | d85b3a3c1e7f4b05ecb701342b439987442a2a79 | |
parent | 943185532121b8b2c37f9a2c3f58b7170d7e942a (diff) | |
download | gs101-4257b599e3848d50e0cfe77fa80c0066b5394708.tar.gz |
histogram: avoid copying by passing a constant reference.
Bug: 301286479
Test: build completed successfully
Change-Id: Iddd4755d971b871e667b7c3b34b8b2fb52b0ac82
-rw-r--r-- | include/histogram/HistogramInfo.h | 2 | ||||
-rw-r--r-- | include/histogram/histogram.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/histogram/HistogramInfo.h b/include/histogram/HistogramInfo.h index 34eada3..2e6602c 100644 --- a/include/histogram/HistogramInfo.h +++ b/include/histogram/HistogramInfo.h @@ -57,7 +57,7 @@ public: HistogramInfo(HistogramType type) { mHistogramType = type; } virtual ~HistogramInfo() {} - virtual void setHistogramPos(HistogramPos pos) = 0; + virtual void setHistogramPos(const HistogramPos& pos) = 0; virtual void callbackHistogram(char16_t* bin) = 0; std::mutex mSetHistInfoMutex; diff --git a/include/histogram/histogram.h b/include/histogram/histogram.h index 7e7693d..cc0cacf 100644 --- a/include/histogram/histogram.h +++ b/include/histogram/histogram.h @@ -27,7 +27,7 @@ class IDLHistogram : public HistogramInfo { public: IDLHistogram() : HistogramInfo(HistogramType::HISTOGRAM_HIDL) {} virtual ~IDLHistogram() {} - virtual void setHistogramPos(HistogramPos pos) {} + virtual void setHistogramPos(const HistogramPos& pos) {} }; #endif // HISTOGRAM_H_ |