Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix meBridge.listCraftableItems and meBridge.listCraftableFluids to not be quadratic. #570

Merged

Commits on Mar 28, 2024

  1. Fix meBridge.listCraftableItems and meBridge.listCraftableFluids to n…

    …ot be quadratic.
    
    Applied Energistics will return the set of all craftable things. Iterate
    over that to generate the list of craftable things, instead of something
    more complicated.
    
    Previously, the code would
    
    1. Iterate over *every* item in the entire ME system.
    2. For *each* non-craftable item, iterate over every craftable item and
       a) create the corresponding lua object
       b) if the craftable item isn't present in ME system, check if the
          list of objects to return contains that object (which requires
          sequentially scanning the list of objects to return.
    
    This meant that
    
    1. If there were no non-craftable items in the ME system, none of the
       craftable items that weren't present in the system would be returned.
    2. The code was quadratic or cubic in runtime.
    tomprince committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    55f21aa View commit details
    Browse the repository at this point in the history