inwc3 / JMPQ3

Native Java mpq archive library
Apache License 2.0
38 stars 17 forks source link

Enforce order for new files #48

Closed alexandrugabrielrait closed 11 months ago

Frotty commented 1 year ago

Thanks for the PR. Can you please add a unit test to assert this behavior?

Frotty commented 1 year ago

Hello?

Frotty commented 11 months ago

@alexandrugabrielrait Actually your implementation is wrong, it just sorts the files by name, which has nothing to do with insertion order. Perhaps it worked in your case, but it doesn't do what you set out to do at all. I added a test and a correct implemention via a LinkedIdentityHashMap in https://github.com/inwc3/JMPQ3/commit/36f7cac31e27ee0f373561d2d481938c71ba5f20