Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clone method #1

Merged
merged 1 commit into from
May 21, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ByteBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
*/
Expand All @@ -49,7 +49,7 @@ ByteBuffer::ByteBuffer(byte* arr, unsigned int size) {
clear();
putBytes(arr, size);
}

#ifdef BB_UTILITY
name = "";
#endif
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down