Comment 21 for bug 203413

Revision history for this message
In , Dietrich-mozilla (dietrich-mozilla) wrote :

(From update of attachment 305702)

>-
>- if (!allTermsFound && !URIHasAnyTagFromTerms(aSet[nodeIndex]->mURI, tagTerms))
>- continue;
>+ // Load up the title, url, tags for the current node as UTF16 strings
>+ NS_ConvertUTF8toUTF16 nodeTitle(aSet[nodeIndex]->mTitle);
>+ // Unescape the URL for search term matching
>+ nsCAutoString cNodeURL(aSet[nodeIndex]->mURI);
>+ NS_ConvertUTF8toUTF16 nodeURL(NS_UnescapeURL(cNodeURL));
>+ // Fetch the tags
>+ nsAutoString nodeTags;
>+ rv = aSet[nodeIndex]->GetTags(nodeTags);

no conversion needed?

also, iirc the direct db access in URIHasTag was originally due to poor performance of the tag service (not to mention level xpconnect traversals), and i believe GetTags() does exactly that.

please test, and if this is still a problem, maybe we should instead have GetTags() use URIHasTag()?

>+ NS_ENSURE_SUCCESS(rv, rv);
>+
>+ // Determine if every search term matches anywhere in the title, url, tag
>+ PRBool matchAll = PR_TRUE;
>+ for (PRInt32 termIndex = terms[queryIndex]->Count(); --termIndex >= 0 &&
>+ matchAll; ) {

nit: weird indent, please line up with parens contents