gh-104018: remove unused format "z" handling in string formatfloat() (#104107)

This is a cleanup overlooked in PR #104033.
This commit is contained in:
John Belmonte 2023-05-07 13:41:42 +09:00 committed by GitHub
parent c53547c907
commit 69621d1b09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 8 deletions

View File

@ -14,14 +14,12 @@ extern "C" {
* F_BLANK ' ' * F_BLANK ' '
* F_ALT '#' * F_ALT '#'
* F_ZERO '0' * F_ZERO '0'
* F_NO_NEG_0 'z'
*/ */
#define F_LJUST (1<<0) #define F_LJUST (1<<0)
#define F_SIGN (1<<1) #define F_SIGN (1<<1)
#define F_BLANK (1<<2) #define F_BLANK (1<<2)
#define F_ALT (1<<3) #define F_ALT (1<<3)
#define F_ZERO (1<<4) #define F_ZERO (1<<4)
#define F_NO_NEG_0 (1<<5)
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -423,9 +423,6 @@ formatfloat(PyObject *v, int flags, int prec, int type,
if (flags & F_ALT) { if (flags & F_ALT) {
dtoa_flags |= Py_DTSF_ALT; dtoa_flags |= Py_DTSF_ALT;
} }
if (flags & F_NO_NEG_0) {
dtoa_flags |= Py_DTSF_NO_NEG_0;
}
p = PyOS_double_to_string(x, type, prec, dtoa_flags, NULL); p = PyOS_double_to_string(x, type, prec, dtoa_flags, NULL);
if (p == NULL) if (p == NULL)

View File

@ -13452,8 +13452,6 @@ formatfloat(PyObject *v, struct unicode_format_arg_t *arg,
if (arg->flags & F_ALT) if (arg->flags & F_ALT)
dtoa_flags |= Py_DTSF_ALT; dtoa_flags |= Py_DTSF_ALT;
if (arg->flags & F_NO_NEG_0)
dtoa_flags |= Py_DTSF_NO_NEG_0;
p = PyOS_double_to_string(x, arg->ch, prec, dtoa_flags, NULL); p = PyOS_double_to_string(x, arg->ch, prec, dtoa_flags, NULL);
if (p == NULL) if (p == NULL)
return -1; return -1;

View File

@ -317,7 +317,6 @@ simple_format_arg_parse(PyObject *fmt, Py_ssize_t *ppos,
case ' ': *flags |= F_BLANK; continue; case ' ': *flags |= F_BLANK; continue;
case '#': *flags |= F_ALT; continue; case '#': *flags |= F_ALT; continue;
case '0': *flags |= F_ZERO; continue; case '0': *flags |= F_ZERO; continue;
case 'z': *flags |= F_NO_NEG_0; continue;
} }
break; break;
} }