Deduplicate the list of haulables if the cache is still dirty after an update
Some mods occasionally leave duplicates in the list of haulables. As a result, the counts in the list and the cache are never equal, invalidating the cache as soon as it's made and ruining performance. This should handle such situations a lot more gracefully
What mod is doing that? Simply removing the new entries added by that other mod sounds a lot like it'd break the functionality they're added for
Pretty sure it's Pick Up and Haul. Sometimes it just starts a job with every item listed twice, and the very next message in the log is "Dirty cache after update". That's after this change, of course, before it would just silently make ListerHaulables:Check take ~0.033ms every call instead of ~0.000ms until i reload a save. I don't think PUAH is doing anything intelligent here, but i suppose this could mess with other mods. I guess this should be a toggle in the options? I know the proper thing to do is to track down and fix whatever is messing up the haulables list, but that's hard
I know PUAH sorts haulables by distance before deciding what to pick up as an optimization, but it definitely shouldn't be adding anything there. Was this tested with a minimal modlist?