Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1773)

Unified Diff: Source/core/svg/SVGPathByteStreamSource.h

Issue 133163007: Use memcpy in SVGPathByteStreamSource::readType (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPathByteStreamSource.h
diff --git a/Source/core/svg/SVGPathByteStreamSource.h b/Source/core/svg/SVGPathByteStreamSource.h
index 0875ef796175e507d9e77639d3663c0208173beb..17ff6988006203c4bda81985be09e7fa56577f2d 100644
--- a/Source/core/svg/SVGPathByteStreamSource.h
+++ b/Source/core/svg/SVGPathByteStreamSource.h
@@ -60,13 +60,9 @@ private:
{
ByteType<DataType> data;
size_t typeSize = sizeof(ByteType<DataType>);
-
- for (size_t i = 0; i < typeSize; ++i) {
- ASSERT(m_streamCurrent < m_streamEnd);
- data.bytes[i] = *m_streamCurrent;
- ++m_streamCurrent;
- }
-
+ ASSERT(m_streamCurrent + typeSize <= m_streamEnd);
+ memcpy(data.bytes, m_streamCurrent, typeSize);
+ m_streamCurrent += typeSize;
return data.value;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698