diff --git a/tensorflow/lite/micro/micro_profiler.cc b/tensorflow/lite/micro/micro_profiler.cc index e349bf73668..cace814514a 100644 --- a/tensorflow/lite/micro/micro_profiler.cc +++ b/tensorflow/lite/micro/micro_profiler.cc @@ -1,4 +1,4 @@ -/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2025 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +14,11 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/micro/micro_profiler.h" +#include #include #include #include +#include #include "tensorflow/lite/kernels/internal/compatibility.h" #include "tensorflow/lite/micro/micro_log.h" @@ -122,9 +124,7 @@ int MicroProfiler::FindExistingOrNextPosition(const char* tag_name) { } void MicroProfiler::ClearEvents() { - for (int i = 0; i < num_events_; i++) { - total_ticks_per_tag_[i].tag = nullptr; - } + std::fill_n(std::begin(total_ticks_per_tag_), num_events_, TicksPerTag{}); num_events_ = 0; }