OpenMods / OpenPeripheral

https://openmods.info
MIT License
67 stars 25 forks source link

getAllStacks() return value and slow execution time #236

Closed csdivad closed 9 years ago

csdivad commented 9 years ago

Since AIO-2 (actually since dev build ~209/210, 208 was fine) the getAllStacks() function return value is a bit strange. Before the changes, it returned a table, the keys were the number of the stack in the inventory and the values were another tables with the information about that stack (raw_name, qty, etc). In recent builds, the values of this inner table are functions (all, doc, keys, basic, select, single...). The basic() and all() returns the expected table with the raw_name and other properties. My problem is the code execution time, which increased by a lot. I have a function which counts specific kind of items in a golden chest. Before this change the execution time seemed instant. Now it's like 3 or 4 seconds (same code with basic() function added to it, and the chest have the same amount of items).

boq commented 9 years ago

Ok, fixed. Until I release, you can also call getAllStacks(false) to get information in new format.