pageldev / libOpenDRIVE

Small, lightweight C++ library for handling OpenDRIVE files
Apache License 2.0
388 stars 136 forks source link

Replace set with vector or another structure that doesn't change the order of the elements #91

Open mohd109 opened 10 months ago

mohd109 commented 10 months ago

Hi, First of all, thanks a lot for your effort since this library came in handy. Just wanted to mention that using set has a problem when we want to read and output the segments, lines, and other parts of the file in the same order. Using vector can easily prevent that since it has no comparator. We did it for our case.

pageldev commented 10 months ago

Hi, thanks! Appreciate it.

Makes sense. Can you point me to the places in the code where you have replaced this? Alternatively, you can also create a pull request and I'll take a look at it. I just want to check if this has any side effects.

mohd109 commented 10 months ago

Anytime! I'm going to share the code with you in Google Drive. https://drive.google.com/file/d/1vCdrpefi7ZhSYy663xPy6Omk2J-BXtAb/view?usp=sharing The changes are basically wherever "set" was used, and replacement of the push_back and insert ones to be compatible with vector. Didn't test the performance though.