[EMAIL PROTECTED] writes: > /* Skip protocol indicator of url */ > - if ((p = strchr(url, ':')) == NULL) { > - return SQLITE_MISUSE; > - } else { > - ++p; > - } > + if (strchr(url, ':')) { > + if (strncmp(url, "sqlite://", 9) != 0) { > + errno = EINVAL; > + return SQLITE_MISUSE; > + } > + p = url + 9; > + } else { > + p = url; > + } > +
Simo, I believe this is a waste. We can't (or at least, shouldn't be able to) get here (into ldb_sqlite3) without the url having a proper protocol indicator. Your new method scans the string twice (once in strchr() and again in strncmp(), unnecessarily I think. If it is possible to get here with a protocol indicator other than the intended one, the higher-level (calling) code should be fixed to ensure that can not happen. Then, the code I had intentionally replaced the tdb code with (pre- this change) is more efficient. Cheers, Derrell