Skip to content

lib: updated filterDuplicateStrings method

Implementation was using a hash map while we are only concerned with the values of the array iterated that are unique and not in the keys themselves, so using a set would be a better idea. An interesting point to note is that none of the tests broke after changing the implementation. 🤔

I was under the impression from the function name that is performs unique elements from the array but was not so. However, I still don't know the cause of implementing this function in the previous manner as it is being used for uniquely identifying elements.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading