@byteluck-fe/model-driven-engine 2.1.0-sourcemap.7 → 2.1.0-sourcemap.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -228,16 +228,15 @@ function flatInstanceForChildren(controls) {
228
228
  if (keys.length === 0) return undefined;
229
229
  var oneKey = keys[0];
230
230
  var otherKeys = keys.slice(1);
231
- cc.time("findItem flatInstance find");
232
- var initInstance = flatInstance.find(function(item) {
233
- return item.id === oneKey;
234
- });
235
- cc.log("\uD83C\uDFE0 findItem flatInstance find result", initInstance);
236
- cc.timeEnd("findItem flatInstance find");
237
- cc.time("findItem instanceMap match");
238
- var initInstance2 = instanceMap[oneKey];
239
- cc.log("\uD83C\uDFE0 findItem instanceMap match result", initInstance2);
240
- cc.timeEnd("findItem instanceMap match");
231
+ // 3.4.1 优化速度,读取instanceMap
232
+ // cc.time('findItem flatInstance find')
233
+ // const initInstance = flatInstance.find((item) => item.id === oneKey)
234
+ // cc.log('🏠 findItem flatInstance find result', initInstance)
235
+ // cc.timeEnd('findItem flatInstance find')
236
+ // cc.time('findItem instanceMap match')
237
+ var initInstance = instanceMap[oneKey][0];
238
+ // cc.log('🏠 findItem instanceMap match result', initInstance)
239
+ // cc.timeEnd('findItem instanceMap match')
241
240
  if (otherKeys.length === 0) return initInstance;
242
241
  // @ts-ignore
243
242
  return otherKeys.reduce(function(prevItem, key) {