aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/ByteString.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-06-08 15:50:58 -0500
committerrogerk <devnull@localhost>2011-06-08 15:50:58 -0500
commit2772dfe8a1eae7c942bb50d84bda3f45b5d7b683 (patch)
tree0171c98d38d419780317398595c511810a19e203 /src/ProtocolBuffers/ByteString.cs
parent0e2d144eb6e08f841ed4476cfff23ad462bbbcd9 (diff)
downloadprotobuf-2772dfe8a1eae7c942bb50d84bda3f45b5d7b683.tar.gz
protobuf-2772dfe8a1eae7c942bb50d84bda3f45b5d7b683.tar.bz2
protobuf-2772dfe8a1eae7c942bb50d84bda3f45b5d7b683.zip
Performance fix for float/double write bytes. Performance fix, do not use Array.Copy.
Diffstat (limited to 'src/ProtocolBuffers/ByteString.cs')
-rw-r--r--src/ProtocolBuffers/ByteString.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ProtocolBuffers/ByteString.cs b/src/ProtocolBuffers/ByteString.cs
index e645a9f2..06708af7 100644
--- a/src/ProtocolBuffers/ByteString.cs
+++ b/src/ProtocolBuffers/ByteString.cs
@@ -123,7 +123,7 @@ namespace Google.ProtocolBuffers
public static ByteString CopyFrom(byte[] bytes, int offset, int count)
{
byte[] portion = new byte[count];
- Array.Copy(bytes, offset, portion, 0, count);
+ Bytes.Copy(bytes, offset, portion, 0, count);
return new ByteString(portion);
}
@@ -259,9 +259,9 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Copies the entire byte array to the destination array provided at the offset specified.
/// </summary>
- public void CopyTo(Array array, int position)
+ public void CopyTo(byte[] array, int position)
{
- Array.Copy(bytes, 0, array, position, bytes.Length);
+ Bytes.Copy(bytes, 0, array, position, bytes.Length);
}
/// <summary>