Lutz Roeder 4 anni fa
parent
commit
193804bd2f
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      source/ncnn.js

+ 6 - 6
source/ncnn.js

@@ -733,7 +733,7 @@ ncnn.Metadata = class {
     constructor(data) {
         this._operatorMap = new Map();
         this._map = new Map();
-        this._attributeCache = new Map();
+        this._attributes = new Map();
         if (data) {
             const items = JSON.parse(data);
             for (const item of items) {
@@ -757,18 +757,18 @@ ncnn.Metadata = class {
 
     attribute(type, name) {
         const key = type + ':' + name;
-        if (!this._attributeCache.has(key)) {
+        if (!this._attributes.has(key)) {
             const schema = this.type(type);
             if (schema && schema.attributes && schema.attributes.length > 0) {
                 for (const attribute of schema.attributes) {
-                    this._attributeCache.set(type + ':' + attribute.name, attribute);
+                    this._attributes.set(type + ':' + attribute.name, attribute);
                 }
             }
-            if (!this._attributeCache.has(key)) {
-                this._attributeCache.set(key, null);
+            if (!this._attributes.has(key)) {
+                this._attributes.set(key, null);
             }
         }
-        return this._attributeCache.get(key);
+        return this._attributes.get(key);
     }
 };