Don't buffer 0 data
This commit is contained in:
@@ -124,6 +124,8 @@ namespace lime {
|
|||||||
int len = val_int (inLen);
|
int len = val_int (inLen);
|
||||||
int start = val_int (inStart);
|
int start = val_int (inStart);
|
||||||
|
|
||||||
|
if (len == 0) return alloc_null ();
|
||||||
|
|
||||||
ByteArray bytes (inByteBuffer);
|
ByteArray bytes (inByteBuffer);
|
||||||
const unsigned char *data = bytes.Bytes ();
|
const unsigned char *data = bytes.Bytes ();
|
||||||
int size = bytes.Size ();
|
int size = bytes.Size ();
|
||||||
@@ -145,6 +147,8 @@ namespace lime {
|
|||||||
int len = val_int (inLen);
|
int len = val_int (inLen);
|
||||||
int start = val_int (inStart);
|
int start = val_int (inStart);
|
||||||
|
|
||||||
|
if (len == 0) return alloc_null ();
|
||||||
|
|
||||||
ByteArray bytes (inByteBuffer);
|
ByteArray bytes (inByteBuffer);
|
||||||
|
|
||||||
const unsigned char *data = bytes.Bytes ();
|
const unsigned char *data = bytes.Bytes ();
|
||||||
|
|||||||
Reference in New Issue
Block a user