Skip to content

Commit

Permalink
pw_multibuf: Cast std::distance() to size_t to avoid implicit conversion
Browse files Browse the repository at this point in the history
Change-Id: I985c8f7b589e047f8a54618c83955afc629a9fba
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232051
Commit-Queue: Auto-Submit <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Carlos Chinchilla <[email protected]>
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Aug 26, 2024
1 parent 005ddff commit a7e3e71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pw_multibuf/public/pw_multibuf/multibuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ class MultiBufChunks {
constexpr const_iterator cend() const { return const_iterator::end(); }

/// Returns the number of `Chunk`s in this `MultiBuf`, including empty chunks.
size_t size() const { return std::distance(begin(), end()); }
size_t size() const {
return static_cast<size_t>(std::distance(begin(), end()));
}

/// Returns the total number of bytes in all `Chunk`s.
size_t size_bytes() const;
Expand Down

0 comments on commit a7e3e71

Please sign in to comment.