Skip to content

Commit

Permalink
Merge pull request #1 from fly2never/master
Browse files Browse the repository at this point in the history
fix clone method
  • Loading branch information
RamseyK committed May 21, 2013
2 parents 9d9b5de + e9fb44d commit 165bf67
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ByteBuffer.cpp
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
/**
* ByteBuffer constructor
* Reserves specified size in internal vector
*
*
* @param size Size (in bytes) of space to preallocate internally. Default is set in DEFAULT_SIZE
*/
ByteBuffer::ByteBuffer(unsigned int size) {
@@ -35,7 +35,7 @@ ByteBuffer::ByteBuffer(unsigned int size) {
/**
* ByteBuffer constructor
* Consume an entire byte array of length len in the ByteBuffer
*
*
* @param arr byte array of data (should be of length len)
* @param size Size of space to allocate
*/
@@ -49,7 +49,7 @@ ByteBuffer::ByteBuffer(byte* arr, unsigned int size) {
clear();
putBytes(arr, size);
}

#ifdef BB_UTILITY
name = "";
#endif
@@ -93,7 +93,7 @@ ByteBuffer* ByteBuffer::clone() {

// Copy data
for(unsigned int i = 0; i < buf.size(); i++) {
ret->put(i, (byte)get(i));
ret->put((byte)get(i));
}

// Reset positions
@@ -165,7 +165,7 @@ void ByteBuffer::replace(byte key, byte rep, unsigned int start, bool firstOccur
// Wasn't actually found, bounds of buffer were exceeded
if((key != 0) && (data == 0))
break;

// Key was found in array, perform replacement
if(data == key) {
buf[i] = rep;

0 comments on commit 165bf67

Please sign in to comment.