Re: [PATCH] streq()

Daniel Egger (degger@fhm.edu)
25 Sep 2002 14:38:32 +0200


--=-l2yCg05z67np/LXnFb9H
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Am Mit, 2002-09-25 um 13.45 schrieb Russell King:

> Small problem - you need to find the length first. Which means you need
> to scan each string, and use the smaller.

In most cases one of the strings is constant and thus the length known=20
at compiletime. I have no idea whether we are allowed (in kernel space)
to read beyond the end of a string, iff we are we could simply use the
fixed length.

> Wouldn't it be faster just to iterate over both strings at the same time
> only once?

Time has shown that the obvious solution is often not the fastest one.
:) Though in this case it really might be.=20

--=20
Servus,
Daniel

--=-l2yCg05z67np/LXnFb9H
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9ka5Ichlzsq9KoIYRAqHZAJ9W7PfHm19uiDVqO57E5Lb3P0v+MgCeIeeG
HhMGxhcHhomFvg7LvbrC1as=
=9/DY
-----END PGP SIGNATURE-----

--=-l2yCg05z67np/LXnFb9H--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/