Skip to content

Commit 648e1fe

Browse files
Passing ofBuffer as reference to avoid copies
1 parent 7952f01 commit 648e1fe

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

libs/ofxLibwebsockets/include/ofxLibwebsockets/Client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace ofxLibwebsockets {
6565
}
6666

6767
// send any binary data
68-
void sendBinary( ofBuffer buffer );
68+
void sendBinary( ofBuffer & buffer );
6969
void sendBinary( unsigned char * data, int size );
7070
void sendBinary( char * data, int size );
7171

libs/ofxLibwebsockets/include/ofxLibwebsockets/Connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace ofxLibwebsockets {
4545
sendBinary( (char *) image.getPixels().getData(), size );
4646
}
4747

48-
void sendBinary( ofBuffer buffer );
48+
void sendBinary( ofBuffer & buffer );
4949
void sendBinary( unsigned char * data, unsigned int size );
5050
void sendBinary( char * data, unsigned int size );
5151

libs/ofxLibwebsockets/include/ofxLibwebsockets/Server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace ofxLibwebsockets {
7777
}
7878

7979
// send any binary data to all connections
80-
void sendBinary( ofBuffer buffer );
80+
void sendBinary( ofBuffer & buffer );
8181
void sendBinary( unsigned char * data, int size );
8282
void sendBinary( char * data, int size );
8383

libs/ofxLibwebsockets/src/Client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ namespace ofxLibwebsockets {
222222
}
223223

224224
//--------------------------------------------------------------
225-
void Client::sendBinary( ofBuffer buffer ){
225+
void Client::sendBinary( ofBuffer & buffer ){
226226
if ( connection != NULL){
227227
connection->sendBinary(buffer);
228228
}

libs/ofxLibwebsockets/src/Connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace ofxLibwebsockets {
8282
}
8383

8484
//--------------------------------------------------------------
85-
void Connection::sendBinary( ofBuffer buffer ){
85+
void Connection::sendBinary( ofBuffer & buffer ){
8686
sendBinary(buffer.getData(), buffer.size());
8787
}
8888

libs/ofxLibwebsockets/src/Server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace ofxLibwebsockets {
160160
}
161161

162162
//--------------------------------------------------------------
163-
void Server::sendBinary( ofBuffer buffer ){
163+
void Server::sendBinary( ofBuffer & buffer ){
164164
sendBinary(buffer.getData(), buffer.size());
165165
}
166166

0 commit comments

Comments
 (0)