From kde-commits Sun Jun 11 10:48:39 2006 From: Mario Teijeiro Otero Date: Sun, 11 Jun 2006 10:48:39 +0000 To: kde-commits Subject: Re: branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf Message-Id: <200606111348.20854.emeteo () escomposlinux ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115002291915722 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart7237717.Vfjh91KKi4" --nextPart7237717.Vfjh91KKi4 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sun June 11 2006 00:23, Albert Astals Cid wrote: > =C2=A0{ > =C2=A0 =C2=A0length =3D str.getLength(); > =C2=A0 =C2=A0s =3D (Unicode *)gmallocn(length, sizeof(Unicode)); > + =C2=A0bool anyNonEncoded =3D false; > =C2=A0 =C2=A0for (int j =3D 0; j < length; ++j) { > =C2=A0 =C2=A0 =C2=A0s[j] =3D pdfDocEncoding[str.getChar(j) & 0xff]; > + =C2=A0 =C2=A0if (!s[j]) anyNonEncoded =3D true; > =C2=A0 =C2=A0} > + =C2=A0if ( anyNonEncoded ) > + =C2=A0{ > + =C2=A0 =C2=A0for (int j =3D 0; j < length; ++j) { > + =C2=A0 =C2=A0 =C2=A0s[j] =3D str.getChar(j); > + =C2=A0 =C2=A0} > + =C2=A0} > =C2=A0} Could it be=20 "for ( int j =3D 0; j < length && !anyNonEncoded ; ++j)" in the first curl ? This way it does't execute the curl twice, except on th= e=20 worst case. Regards =2D-=20 Keep away software patents from Europe. GPG Fingerprint: 7788 5526 6B2A 47BE 9618 8F48 30AB 1CF9 7799 71DC http://cernicalo.escomposlinux.org --nextPart7237717.Vfjh91KKi4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBEjAMEMKsc+XeZcdwRAkxWAJ9wgeyQO9YlXmGpz84CauH33xapqwCggLv1 7uM/5Pcow7DQzvNa4XQLN38= =/fEq -----END PGP SIGNATURE----- --nextPart7237717.Vfjh91KKi4--