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
- 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/
This archive was generated by hypermail 2b29 : Mon Sep 30 2002 - 22:00:22 EST