Skip to content

Simplify hash type name getters - #185

Merged
ifduyue merged 2 commits into
masterfrom
fix/simplify-name-getters
Aug 12, 2026
Merged

Simplify hash type name getters#185
ifduyue merged 2 commits into
masterfrom
fix/simplify-name-getters

Conversation

@ifduyue

@ifduyue ifduyue commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Simplify the four get_name implementations and drop a now-unused include.

Changes

  • src/_xxhash.c: use PyUnicode_FromString(name) instead of PyUnicode_FromStringAndSize(name, strlen(name)) in the xxh32/xxh64/xxh3_64/xxh3_128 name getters
  • Remove the #include <string.h> that only served those strlen calls
  • Bump version to 4.0.0.dev7

Testing

  • Name getters verified for all four types (XXH32, XXH64, XXH3_64, XXH3_128)
  • Full test suite passes (132 tests)

Replace PyUnicode_FromStringAndSize(name, strlen(name)) with
PyUnicode_FromString(name) in the four get_name implementations, and
drop the now-unused <string.h> include.
@codspeed-hq

codspeed-hq Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 148 untouched benchmarks
⏩ 66 skipped benchmarks1


Comparing fix/simplify-name-getters (1ff346e) with master (8b83ba2)

Open in CodSpeed

Footnotes

  1. 66 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ifduyue
ifduyue merged commit b274f52 into master Aug 12, 2026
85 of 86 checks passed
@ifduyue
ifduyue deleted the fix/simplify-name-getters branch August 12, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant