UserData map not going back to null value once any data is set

Looking at the spatial code I saw that the userdata hashmap is created at the time the first data is added. However, this map is not going back to it null value (which is much more memory friendly), once it goes empty so I was wondering if this had any special reason or if I should pr a change for it.

no reason, the initial null was a later optimisation after someone found that it is created for every spatial, and rarely actually used.

So, you suggest me to submit that pr?

So, on the one hand, I don’t think it’s a big deal if we want to ‘fix’ this… on the other hand, if you are setting and clearing user data on a spatial then you might be abusing UserData.

In my case, yes I’m abusing from it a little bit (I’m using it just for one thing and it’s a bit hacking on a load-parse-to-logic thing) but while I don’t want to think on the correct way to achieve what I want and I’m just fine with that abuse I though that what it would be less “bad done” if that hashmap wasn’t remaining there after the “patch thing”.

I can’t understand what do you exactly mean with that. However, I don’t think that change could harm anyone but only be handful.

I mean that I’m not against the fix. It definitely does increase our maintenance burden for a relatively small effect… but it doesn’t increase it much.

Yep… know about that xD.