Skip to content

Commit 95e1021

Browse files
committed
remove un-necessary specializations
1 parent 93a7a9b commit 95e1021

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

Modules/_ssl.c

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6820,30 +6820,17 @@ sslmodule_init_constants(PyObject *m)
68206820

68216821
/* internal hashtable (errcode, libcode) => (reason [PyObject * (unicode)]) */
68226822

6823-
static Py_uhash_t
6824-
py_ht_errcode_to_name_hash(const void *key)
6825-
{
6826-
py_ssl_errcode code = (py_ssl_errcode)(uintptr_t)key;
6827-
return (Py_uhash_t)(code);
6828-
}
6829-
6830-
static int
6831-
py_ht_errcode_to_name_comp(const void *k1, const void *k2)
6832-
{
6833-
return (uintptr_t)k1 == (uintptr_t)k2;
6834-
}
6835-
68366823
static void
68376824
py_ht_errcode_to_name_free(void *value) {
6838-
// assert(PyUnicode_CheckExact((PyObject *)value));
6839-
// Py_CLEAR(value);
6825+
assert(PyUnicode_CheckExact((PyObject *)value));
6826+
Py_CLEAR(value);
68406827
}
68416828

68426829
static _Py_hashtable_t *
68436830
py_ht_errcode_to_name_create(void) {
68446831
_Py_hashtable_t *table = _Py_hashtable_new_full(
6845-
py_ht_errcode_to_name_hash,
6846-
py_ht_errcode_to_name_comp,
6832+
_Py_hashtable_hash_ptr,
6833+
_Py_hashtable_compare_direct,
68476834
NULL,
68486835
py_ht_errcode_to_name_free,
68496836
NULL
@@ -6891,12 +6878,6 @@ py_ht_errcode_to_name_create(void) {
68916878

68926879
/* internal hashtable (libcode) => (libname [PyObject * (unicode)]) */
68936880

6894-
static int
6895-
py_ht_libcode_to_name_comp(const void *k1, const void *k2)
6896-
{
6897-
return (uintptr_t)k1 == (uintptr_t)k2;
6898-
}
6899-
69006881
static void
69016882
py_ht_libcode_to_name_free(void *value) {
69026883
assert(PyUnicode_CheckExact((PyObject *)value));
@@ -6907,7 +6888,7 @@ static _Py_hashtable_t *
69076888
py_ht_libcode_to_name_create(void) {
69086889
_Py_hashtable_t *table = _Py_hashtable_new_full(
69096890
_Py_hashtable_hash_ptr,
6910-
py_ht_libcode_to_name_comp,
6891+
_Py_hashtable_compare_direct,
69116892
NULL,
69126893
py_ht_libcode_to_name_free,
69136894
NULL

0 commit comments

Comments
 (0)