TheBusyBiscuit / CS-CoreLib2

This is an updated (LITE) Version of CS-CoreLib. Instead of being a hard dependency, it should be shaded instead.
MIT License
19 stars 18 forks source link

Deep Copy utilities #183

Closed md5sha256 closed 3 years ago

md5sha256 commented 3 years ago

Adds a util class for deep copying Collection, Map and arrays. I haven't tested the changes but this should be simple enough that a quick glance will spot errors. If that's insufficient I can write a simple unit test for this.

md5sha256 commented 3 years ago

Should be fixed

md5sha256 commented 3 years ago

Actually, are the generics on #deepCopy(Collection, Function, Collection) necessary? Maybe I can just have them as Collection instead. Same goes for #deepCopy(Map, Function, Map)

EDIT: Removed the unnecessary generics

TheBusyBiscuit commented 3 years ago

Actually, are the generics on #deepCopy(Collection, Function, Collection) necessary? Maybe I can just have them as Collection instead. Same goes for #deepCopy(Map, Function, Map)

EDIT: Removed the unnecessary generics

Yeah, that is much better. The base type is more than enough here