emirpasic / gods

GoDS (Go Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more
Other
16.32k stars 1.77k forks source link

fix arraylist unmarshalling #248

Open zenbal opened 5 months ago

zenbal commented 5 months ago

When calling json.Unmarshal(data, &list.elements) the cap(list.elements) is usually larger than the actual length. In that case the check in the growBy function fails and list.elements size is not adjusted. Maybe I'm missing something here but from what I can tell, the resize function always ensures that the length is equal to the capacity.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud