BlackToppStudios / Mezz_Foundation

Foundational Data types that enforce no opinions on how to build games and provide many facilities that complex games need. This largely avoids graphics and physics, but provides tools like the SortedVector, CountedPtr and HashedString classes.
GNU General Public License v3.0
3 stars 0 forks source link

Port and update of SortedVector #43

Closed feartheducky closed 5 years ago

feartheducky commented 5 years ago

Updated SortedVector and added to Mezz_Foundation.

codecov[bot] commented 5 years ago

Codecov Report

Merging #43 into master will decrease coverage by 0.31%. The diff coverage is 95.55%.

@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
- Coverage    98.8%   98.49%   -0.32%     
==========================================
  Files           8        9       +1     
  Lines         420      465      +45     
==========================================
+ Hits          415      458      +43     
- Misses          5        7       +2
codecov[bot] commented 5 years ago

Codecov Report

Merging #43 into master will decrease coverage by 0.31%. The diff coverage is 95.55%.

@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
- Coverage    98.8%   98.49%   -0.32%     
==========================================
  Files           8        9       +1     
  Lines         420      465      +45     
==========================================
+ Hits          415      458      +43     
- Misses          5        7       +2
Sqeaky commented 5 years ago

On line 131 in the tests, Why start with a a 5 element destination vector? The source vector has six elements. Just quirky. At first glance these all looked like the same counts, and someone reading that might think this is required for some reason.

In the tests for adding a range, the range added is sorted. Reading the code and seeing how the sorted values are interleaved make it clear that this is sorting correctly. Including a unsorted item for the vector. So again not a major issue,I wouldn't make a commit just to fix this.

I am not a huge fan of the 0 == (FindifFail - FindifEnd) because it seems more convoluted than just comparing the iterators, but seems like a way to avoid to avoid the streaming requirement of TEST_EQUAL. I opened ticket against Mezz_Test to fix this, so this is probably the best solution we have now: https://github.com/BlackToppStudios/Mezz_Test/issues/47

This looks good to merge.