Skip to content

Commit

Permalink
Merge pull request #2312 from sepinf-inc/BookmarkCacheInvalidation
Browse files Browse the repository at this point in the history
Properly invalidates internal unions cache after bookmark
lfcnassif authored Sep 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 3abd400 + b2191b9 commit fe59d54
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -185,6 +185,7 @@ public synchronized void addBookmark(List<Integer> ids, int bookmark) {
RoaringBitmap bookmarkBitmap = bookmarks.get(bookmark);
for (Integer id : ids) {
bookmarkBitmap.add(id);
//updates cache
if (unionAll != null) {
unionAll.add(id);
}
@@ -265,6 +266,8 @@ public synchronized int newBookmark(String bookmarkName) {
bookmarkColors = new TreeMap<Integer, Color>();
bookmarkColors.put(bookmarkId, null);

unionAll = null;// invalidates unionAll

return bookmarkId;
}

@@ -279,6 +282,7 @@ public synchronized void delBookmark(int bookmark) {
bookmarkColors.remove(bookmark);
reportBookmarks.remove(bookmark);
bookmarks.remove(bookmark);
unionAll = null;// invalidates unionAll
}

public synchronized void renameBookmark(int bookmarkId, String newBookmark) {
Original file line number Diff line number Diff line change
@@ -185,13 +185,15 @@ public void removeBookmark(Set<IItemId> ids, String bookmarkName) {
public void newBookmark(String bookmarkName) {
for (IBookmarks m : map.values())
m.newBookmark(bookmarkName);
invalidadeCaches();
}

public void delBookmark(String bookmarkName) {
for (IBookmarks m : map.values()) {
int bookmarkId = m.getBookmarkId(bookmarkName);
m.delBookmark(bookmarkId);
}
invalidadeCaches();
}

public void renameBookmark(String oldBookmark, String newBookmark) {

0 comments on commit fe59d54

Please sign in to comment.