unnecessary realloc
Change-Id: Iafd6495a8b6a2b371cf004e4383ed92ac6ae4bd2 Reviewed-on: https://gerrit.libreoffice.org/23760 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
@@ -1489,14 +1489,13 @@ uno::Any Content::open(
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Sequence< sal_Int8 > aBuffer;
|
uno::Sequence< sal_Int8 > aBuffer;
|
||||||
sal_Int32 nRead = xIn->readSomeBytes( aBuffer, 65536 );
|
while (true)
|
||||||
|
|
||||||
while ( nRead > 0 )
|
|
||||||
{
|
{
|
||||||
|
sal_Int32 nRead = xIn->readSomeBytes( aBuffer, 65536 );
|
||||||
|
if (!nRead)
|
||||||
|
break;
|
||||||
aBuffer.realloc( nRead );
|
aBuffer.realloc( nRead );
|
||||||
xOut->writeBytes( aBuffer );
|
xOut->writeBytes( aBuffer );
|
||||||
aBuffer.realloc( 0 );
|
|
||||||
nRead = xIn->readSomeBytes( aBuffer, 65536 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xOut->closeOutput();
|
xOut->closeOutput();
|
||||||
|
@@ -1484,14 +1484,14 @@ uno::Any Content::open(
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Sequence< sal_Int8 > aBuffer;
|
uno::Sequence< sal_Int8 > aBuffer;
|
||||||
sal_Int32 nRead = xIn->readSomeBytes( aBuffer, 65536 );
|
|
||||||
|
|
||||||
while ( nRead > 0 )
|
while (true)
|
||||||
{
|
{
|
||||||
|
sal_Int32 nRead = xIn->readSomeBytes( aBuffer, 65536 );
|
||||||
|
if (!nRead)
|
||||||
|
break;
|
||||||
aBuffer.realloc( nRead );
|
aBuffer.realloc( nRead );
|
||||||
xOut->writeBytes( aBuffer );
|
xOut->writeBytes( aBuffer );
|
||||||
aBuffer.realloc( 0 );
|
|
||||||
nRead = xIn->readSomeBytes( aBuffer, 65536 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xOut->closeOutput();
|
xOut->closeOutput();
|
||||||
@@ -2417,14 +2417,13 @@ bool Content::storeData( const uno::Reference< io::XInputStream >& xData,
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
uno::Sequence< sal_Int8 > aBuffer;
|
uno::Sequence< sal_Int8 > aBuffer;
|
||||||
sal_Int32 nRead = xData->readSomeBytes( aBuffer, 65536 );
|
while (true)
|
||||||
|
|
||||||
while ( nRead > 0 )
|
|
||||||
{
|
{
|
||||||
|
sal_Int32 nRead = xData->readSomeBytes( aBuffer, 65536 );
|
||||||
|
if (!nRead)
|
||||||
|
break;
|
||||||
aBuffer.realloc( nRead );
|
aBuffer.realloc( nRead );
|
||||||
xOut->writeBytes( aBuffer );
|
xOut->writeBytes( aBuffer );
|
||||||
aBuffer.realloc( 0 );
|
|
||||||
nRead = xData->readSomeBytes( aBuffer, 65536 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
closeOutputStream( xOut );
|
closeOutputStream( xOut );
|
||||||
|
Reference in New Issue
Block a user