# HG changeset patch # User drewp@bigasterisk.com # Date 2023-05-29 22:17:28 # Node ID 1b7cde922c3db3b8595cdea6d8559092092883f3 # Parent dd9474bef2a658ab811599a6a69a795d33722b88 save some work diff --git a/light9/web/SyncedGraph.ts b/light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts +++ b/light9/web/SyncedGraph.ts @@ -51,7 +51,10 @@ export class SyncedGraph { this.cachedFloatValues = new Map(); // s + '|' + p -> number this.cachedUriValues = new Map(); // s + '|' + p -> Uri - this._applyPatch(patchToDeleteEntireGraph(this.graph)); + const p = patchToDeleteEntireGraph(this.graph); + if (!p.isEmpty()) { + this._applyPatch(p); + } // if we had a Store already, this lets N3.Store free all its indices/etc this.graph = new N3.Store(); this.rebuildPrefixFuncs(this.prefixes);