Skip to content

Commit

Permalink
Fix #29326 as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Sep 19, 2023
1 parent e55e143 commit 72c3f84
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/lib/support/Span.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ using MutableCharSpan = Span<char>;

inline CHIP_ERROR CopySpanToMutableSpan(ByteSpan span_to_copy, MutableByteSpan & out_buf)
{
VerifyOrReturnError(!span_to_copy.empty(), CHIP_ERROR_INVALID_ARGUMENT); // why?
VerifyOrReturnError(out_buf.size() >= span_to_copy.size(), CHIP_ERROR_BUFFER_TOO_SMALL);

memcpy(out_buf.data(), span_to_copy.data(), span_to_copy.size());
Expand All @@ -341,7 +340,6 @@ inline CHIP_ERROR CopySpanToMutableSpan(ByteSpan span_to_copy, MutableByteSpan &

inline CHIP_ERROR CopyCharSpanToMutableCharSpan(CharSpan cspan_to_copy, MutableCharSpan & out_buf)
{
VerifyOrReturnError(!cspan_to_copy.empty(), CHIP_ERROR_INVALID_ARGUMENT); // why?
VerifyOrReturnError(out_buf.size() >= cspan_to_copy.size(), CHIP_ERROR_BUFFER_TOO_SMALL);

memcpy(out_buf.data(), cspan_to_copy.data(), cspan_to_copy.size());
Expand Down

0 comments on commit 72c3f84

Please sign in to comment.