Messages in this thread | | | Subject | Re: [PATCH] streq() | From | Daniel Egger <> | Date | 25 Sep 2002 14:38:32 +0200 |
| |
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 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.
-- Servus, Daniel [unhandled content-type:application/pgp-signature] | |