From 76e2db61ee15a78c0be95a563ef74c9e2493fa84 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Thu, 2 May 2024 14:30:39 +0100 Subject: ipa: libipa: Allow creation of empty Histogram For convenience's sake allow the creation of empty Histograms so they can be embedded within other Classes and filled out with data at some later point in time. Reviewed-by: Stefan Klug Reviewed-by: Paul Elder Signed-off-by: Daniel Scally Signed-off-by: Kieran Bingham --- src/ipa/libipa/histogram.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ipa/libipa/histogram.h') diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h index 05bb4b80..54bb2a19 100644 --- a/src/ipa/libipa/histogram.h +++ b/src/ipa/libipa/histogram.h @@ -22,6 +22,7 @@ namespace ipa { class Histogram { public: + Histogram() { cumulative_.push_back(0); } Histogram(Span data); size_t bins() const { return cumulative_.size() - 1; } uint64_t total() const { return cumulative_[cumulative_.size() - 1]; } -- cgit v1.2.1