Commit 28af3827 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Convert these to getStaticString

parent 86a995bc
...@@ -321,7 +321,7 @@ static PyObject* abstract_get_bases(PyObject* cls) noexcept { ...@@ -321,7 +321,7 @@ static PyObject* abstract_get_bases(PyObject* cls) noexcept {
static PyObject* __bases__ = NULL; static PyObject* __bases__ = NULL;
if (__bases__ == NULL) { if (__bases__ == NULL) {
__bases__ = PyString_InternFromString("__bases__"); __bases__ = getStaticString("__bases__");
if (__bases__ == NULL) if (__bases__ == NULL)
return NULL; return NULL;
} }
...@@ -394,7 +394,7 @@ static int recursive_isinstance(PyObject* inst, PyObject* cls) noexcept { ...@@ -394,7 +394,7 @@ static int recursive_isinstance(PyObject* inst, PyObject* cls) noexcept {
static PyObject* __class__ = NULL; static PyObject* __class__ = NULL;
if (__class__ == NULL) { if (__class__ == NULL) {
__class__ = PyString_InternFromString("__class__"); __class__ = getStaticString("__class__");
if (__class__ == NULL) if (__class__ == NULL)
return -1; return -1;
} }
...@@ -2156,7 +2156,7 @@ extern "C" PyObject* _PyNumber_ConvertIntegralToInt(PyObject* integral, const ch ...@@ -2156,7 +2156,7 @@ extern "C" PyObject* _PyNumber_ConvertIntegralToInt(PyObject* integral, const ch
const char* type_name; const char* type_name;
static PyObject* int_name = NULL; static PyObject* int_name = NULL;
if (int_name == NULL) { if (int_name == NULL) {
int_name = PyString_InternFromString("__int__"); int_name = getStaticString("__int__");
if (int_name == NULL) if (int_name == NULL)
return NULL; return NULL;
} }
...@@ -2287,7 +2287,7 @@ extern "C" PyObject* PyNumber_Long(PyObject* o) noexcept { ...@@ -2287,7 +2287,7 @@ extern "C" PyObject* PyNumber_Long(PyObject* o) noexcept {
Py_ssize_t buffer_len; Py_ssize_t buffer_len;
if (trunc_name == NULL) { if (trunc_name == NULL) {
trunc_name = PyString_InternFromString("__trunc__"); trunc_name = getStaticString("__trunc__");
if (trunc_name == NULL) if (trunc_name == NULL)
return NULL; return NULL;
} }
......
...@@ -328,7 +328,7 @@ extern "C" PyObject* PyObject_Unicode(PyObject* v) noexcept { ...@@ -328,7 +328,7 @@ extern "C" PyObject* PyObject_Unicode(PyObject* v) noexcept {
/* We're an instance of a classic class */ /* We're an instance of a classic class */
/* Try __unicode__ from the instance -- alas we have no type */ /* Try __unicode__ from the instance -- alas we have no type */
if (!unicodestr) { if (!unicodestr) {
unicodestr = PyString_InternFromString("__unicode__"); unicodestr = getStaticString("__unicode__");
if (!unicodestr) if (!unicodestr)
return NULL; return NULL;
} }
......
...@@ -173,7 +173,7 @@ Box* min_max(Box* arg0, BoxedTuple* args, BoxedDict* kwargs, int opid) { ...@@ -173,7 +173,7 @@ Box* min_max(Box* arg0, BoxedTuple* args, BoxedDict* kwargs, int opid) {
Box* extremVal; Box* extremVal;
if (kwargs && kwargs->d.size()) { if (kwargs && kwargs->d.size()) {
static BoxedString* key_str = static_cast<BoxedString*>(PyString_InternFromString("key")); static BoxedString* key_str = static_cast<BoxedString*>(getStaticString("key"));
auto it = kwargs->d.find(key_str); auto it = kwargs->d.find(key_str);
if (it != kwargs->d.end() && kwargs->d.size() == 1) { if (it != kwargs->d.end() && kwargs->d.size() == 1) {
key_func = it->second; key_func = it->second;
......
...@@ -1044,7 +1044,7 @@ static PyObject* half_binop(PyObject* v, PyObject* w, char* opname, binaryfunc t ...@@ -1044,7 +1044,7 @@ static PyObject* half_binop(PyObject* v, PyObject* w, char* opname, binaryfunc t
} }
if (coerce_obj == NULL) { if (coerce_obj == NULL) {
coerce_obj = PyString_InternFromString("__coerce__"); coerce_obj = getStaticString("__coerce__");
if (coerce_obj == NULL) if (coerce_obj == NULL)
return NULL; return NULL;
} }
......
...@@ -36,7 +36,7 @@ static PyObject* try_complex_special_method(PyObject* op) noexcept { ...@@ -36,7 +36,7 @@ static PyObject* try_complex_special_method(PyObject* op) noexcept {
static PyObject* complexstr; static PyObject* complexstr;
if (complexstr == NULL) { if (complexstr == NULL) {
complexstr = PyString_InternFromString("__complex__"); complexstr = getStaticString("__complex__");
if (complexstr == NULL) if (complexstr == NULL)
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment