Releases: DusanKasan/Knapsack
Releases · DusanKasan/Knapsack
Additional runtime checks and documentation updates
- Breaking change: If inputFactory returns non-collection, throw InvalidReturnValue
- Documentation updated
Huge performance improvements
Moving Collection from Iterator to Traversable allows for huge performance gains (some 4x improvement at the very least)
Transpose added
- Transpose functionality adedd
PrintDump added
- PrintDump function added, to make debugging easier. Prints debug output, but returns the original collection.
Dump added
- Dump function added, to make debugging easier.
Only/extract bug fixed
- Fixed bug: the only function always included the item with key equal to zero in the result. Caused by comparing string == 0. Also affected extract.
Replace by key functionality added
- ReplaceByKeys function added
Sum and average return float/int as needed
- Breaking change: sum function will return integer by default, float if there are float type elements
- Breaking change: average function will not force return float and will return integer if the sum/count result is integer
Some of the utility functions integrated into Collection
- The functionality of sum, average, min, max and concatenate moved into collection.
- Sum collection function added
- Average collection function added
- Min collection function added
- Max collection function added
- ToString collection function added
- Breaking change: sum utility function removed
- Breaking change: average utility function removed
- Breaking change: min utility function removed
- Breaking change: max utility function removed
- Breaking change: concatenate utility function removed
Size comparison functions added
- sizeIsExactly function added
- sizeIsGreaterThan function added
- sizeIsLessThan function added
- sizeIsBetween function added
Use these for size comparison as they don't need to traverse entire collection (if possible) to provide result.