mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
use tmp buffer to avoid copying one byte at a time.
This commit is contained in:
parent
c068126c56
commit
10d6394641
1 changed files with 9 additions and 3 deletions
|
@ -285,9 +285,15 @@ static void
|
|||
mem_stream_copyFromStream( XWStreamCtxt* p_sctx, XWStreamCtxt* src,
|
||||
XP_U16 nBytes )
|
||||
{
|
||||
while ( nBytes-- ) {
|
||||
XP_U8 byt = stream_getU8( src );
|
||||
stream_putU8( p_sctx, byt );
|
||||
while ( nBytes > 0 ) {
|
||||
XP_U8 buf[256];
|
||||
XP_U16 len = sizeof(buf);
|
||||
if ( nBytes < len ) {
|
||||
len = nBytes;
|
||||
}
|
||||
stream_getBytes( src, buf, len );
|
||||
stream_putBytes( p_sctx, buf, len );
|
||||
nBytes -= len;
|
||||
}
|
||||
} /* mem_stream_copyFromStream */
|
||||
|
||||
|
|
Loading…
Reference in a new issue