Skip to content

v1.2.1 - Critical Safety and Performance Fixes

Choose a tag to compare

@umputun umputun released this 11 Aug 21:39
· 2 commits to master since this release
94f699b

Hotfix Release

Security & Safety Fixes

  • Fixed unsafe byte-to-string conversion - Replaced unsafe pointer manipulation with safe string() conversion, eliminating undefined behavior risks

Performance Improvements

  • Optimized HasCommonElement - Improved from O(n×m) to O(n+m) using map-based approach
  • Optimized DeDupBig - Now uses map[string]struct{} for better memory efficiency

Bug Fixes

  • Fixed ContainsAnySubstring - Now properly skips empty substrings instead of always returning true
  • Fixed DeDupBig confusion - Replaced misleading visited[k] = found pattern with clear visited[k] = struct{}{}

Testing

  • Added comprehensive test cases for empty string edge cases
  • Achieved 98.9% test coverage
  • All tests passing, linter clean

Dependencies

  • No dependency changes