Index: Source/core/svg/SVGPathByteStream.h |
diff --git a/Source/core/svg/SVGPathByteStream.h b/Source/core/svg/SVGPathByteStream.h |
index d596ce45fc879d04ac06b30dc5264071f9c70762..1fedc1e11a22853f75748c64a15df7d8027f44cb 100644 |
--- a/Source/core/svg/SVGPathByteStream.h |
+++ b/Source/core/svg/SVGPathByteStream.h |
@@ -26,21 +26,11 @@ |
namespace WebCore { |
-// Type definitions for the byte stream data |
-typedef union { |
- bool value; |
- unsigned char bytes[sizeof(bool)]; |
-} BoolByte; |
- |
-typedef union { |
- float value; |
- unsigned char bytes[sizeof(float)]; |
-} FloatByte; |
- |
-typedef union { |
- unsigned short value; |
- unsigned char bytes[sizeof(unsigned short)]; |
-} UnsignedShortByte; |
+template<typename DataType> |
+union ByteType { |
+ DataType value; |
+ unsigned char bytes[sizeof(DataType)]; |
+}; |
class SVGPathByteStream { |
WTF_MAKE_FAST_ALLOCATED; |
@@ -61,15 +51,11 @@ public: |
DataIterator begin() { return m_data.begin(); } |
DataIterator end() { return m_data.end(); } |
void append(unsigned char byte) { m_data.append(byte); } |
- void append(SVGPathByteStream* other) |
- { |
- for (DataIterator it = other->begin(); it != other->end(); ++it) |
- append(*it); |
- } |
+ void append(SVGPathByteStream* other) { m_data.append(other->m_data); } |
void clear() { m_data.clear(); } |
void reserveInitialCapacity(size_t size) { m_data.reserveInitialCapacity(size); } |
void shrinkToFit() { m_data.shrinkToFit(); } |
- bool isEmpty() const { return !m_data.size(); } |
+ bool isEmpty() const { return m_data.isEmpty(); } |
unsigned size() const { return m_data.size(); } |
// Only defined to let SVGAnimatedPathAnimator use the standard list code paths - this method is never called. |