Closed Bug 383827 Opened 18 years ago Closed 18 years ago

Make bookmark filtering stable

Categories

(Camino Graveyard :: Bookmarks, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stuart.morgan+bugzilla, Assigned: stuart.morgan+bugzilla)

References

Details

(Whiteboard: fixed1.8.1.5)

Attachments

(1 file)

Attached patch fixSplinter Review
Right now the bookmark search API builds and returns a set of matching bookmarks, rather than an array. This has several effects: - bookmark filtering is not at all order-preserving, which is annoying - we do extra work uniquing things that are already known to be unique - we do extra work to support fast lookup, when all the client wants or needs is an array to iterate over Not doing extra work to degrade the UE seems like a no-brainer.
Attachment #267789 - Flags: superreview?(joshmoz)
Blocks: 338558
Thanks, Stuart. Are there any advantages of using a set that we might be missing out on here? What if someone has the same page in bookmarks two or three times? (My expectation, I guess, would be that a search finds all instances of that bookmark, not just one, so this is an improvement in my book.) How about speed impact?
We don't define equality that way on bookmarks; it's impossible under the current implementation to have two bookmarks which are equal, which is why I said they are known to be unique. As for speed, I think I was pretty clear that the set is doing extra work.
Comment on attachment 267789 [details] [diff] [review] fix Fine with me, but what does this have to do with the description for this bug?
Attachment #267789 - Flags: superreview?(joshmoz) → superreview+
(In reply to comment #3) > Fine with me, but what does this have to do with the description for this bug? Stable in the sort sense (i.e., order-preserving).
Assignee: nobody → stuart.morgan
Whiteboard: [needs checkin]
Landed on trunk and MOZILLA_1_8_BRANCH.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [needs checkin] → fixed1.8.1.5
This apparently doesn't compile against 10.3* SDK or gcc 3: /builds/tinderbox/Camino/Darwin_7.9.0_Depend/mozilla/camino/src/bookmarks/BookmarkManager.mm: In function `NSArray* -[BookmarkManager searchBookmarksContainer:forString:inFieldWithTag:](BookmarkManager*, objc_selector*, BookmarkFolder*, NSString*, int)': /builds/tinderbox/Camino/Darwin_7.9.0_Depend/mozilla/camino/src/bookmarks/BookmarkManager.mm:697: error: cannot convert `NSArray*' to `NSSet*' in initialization ** BUILD FAILED ** (Only boxset gives a useful error message, which is bad in another way)
I missed a file when checking in; it should go green next time around.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: