[Editor] Use a null instead of an empty stats object when sending the telemetry

This commit is contained in:
Calixte Denizet 2024-03-04 10:18:24 +01:00
parent 29c493d36b
commit d096dc79b2

View File

@ -214,7 +214,7 @@ class AnnotationStorage {
}
get editorStats() {
const stats = Object.create(null);
let stats = null;
const typeToEditor = new Map();
for (const value of this.#storage.values()) {
if (!(value instanceof AnnotationEditor)) {
@ -228,6 +228,7 @@ class AnnotationStorage {
if (!typeToEditor.has(type)) {
typeToEditor.set(type, Object.getPrototypeOf(value).constructor);
}
stats ||= Object.create(null);
const map = (stats[type] ||= new Map());
for (const [key, val] of Object.entries(editorStats)) {
if (key === "type") {