aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/data_src.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-06-08 05:28:32 -0400
committerJack Lloyd <[email protected]>2018-06-08 05:28:32 -0400
commit4c3eb886c69041922aeaabcb57e3ff0602d5bbc5 (patch)
tree35de6b42f3a43fe0d18d1bc59bccd0b2683ee595 /src/lib/utils/data_src.cpp
parent4407dabb4e95488851323d134d60f893729795c3 (diff)
Constify some local variables
Diffstat (limited to 'src/lib/utils/data_src.cpp')
-rw-r--r--src/lib/utils/data_src.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/utils/data_src.cpp b/src/lib/utils/data_src.cpp
index d99f9c97f..c5689534f 100644
--- a/src/lib/utils/data_src.cpp
+++ b/src/lib/utils/data_src.cpp
@@ -59,7 +59,7 @@ size_t DataSource::discard_next(size_t n)
*/
size_t DataSource_Memory::read(uint8_t out[], size_t length)
{
- size_t got = std::min<size_t>(m_source.size() - m_offset, length);
+ const size_t got = std::min<size_t>(m_source.size() - m_offset, length);
copy_mem(out, m_source.data() + m_offset, got);
m_offset += got;
return got;
@@ -79,7 +79,7 @@ size_t DataSource_Memory::peek(uint8_t out[], size_t length,
const size_t bytes_left = m_source.size() - m_offset;
if(peek_offset >= bytes_left) return 0;
- size_t got = std::min(bytes_left - peek_offset, length);
+ const size_t got = std::min(bytes_left - peek_offset, length);
copy_mem(out, &m_source[m_offset + peek_offset], got);
return got;
}