Skip to content
Myr

[svn] " -> "

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent b79e32b · Browse files · 1 file+7 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−8 removed

  • other:+7 added−8 removed

1 file+7 added−8 removed

modified:jinja/_speedups.c+7 added-8 removed
62 unmodified lines
6364 amp = ((PyUnicodeObject*)PyUnicode_DecodeASCII("&", 5, NULL))->str;65 lt = ((PyUnicodeObject*)PyUnicode_DecodeASCII("<", 4, NULL))->str;66 gt = ((PyUnicodeObject*)PyUnicode_DecodeASCII(">", 4, NULL))->str;67 qt = ((PyUnicodeObject*)PyUnicode_DecodeASCII(""", 5, NULL))->str;67 qt = ((PyUnicodeObject*)PyUnicode_DecodeASCII(""", 6, NULL))->str;6869 Py_DECREF(datastructure);70 Py_DECREF(exceptions);71 return 1;
11 unmodified lines
83 PyUnicodeObject *in, *out;84 Py_UNICODE *outp;85 int i, len;8687 int quotes = 0;88 PyObject *text = NULL;87 PyObject *text = NULL, *use_quotes = NULL;8890 /* XXX: "b" is "tiny int", not bool. */91 if (!PyArg_ParseTuple(args, "O|b", &text, &quotes))89 if (!PyArg_ParseTuple(args, "O|O", &text, &use_quotes))90 return NULL;91 int quotes = use_quotes && PyObject_IsTrue(use_quotes);92 in = (PyUnicodeObject*)PyObject_Unicode(text);93 if (!in)94 return NULL;95
4 unmodified lines
100 case '&':101 len += 5;102 break;103 case '"':105 len += quotes ? 5 : 1;104 len += quotes ? 6 : 1;105 break;106 case '<':107 case '>':108 len += 4;
21 unmodified lines
130 outp += 5;131 break;132 case '"':133 if (quotes) {135 Py_UNICODE_COPY(outp, qt, 5);136 outp += 5;134 Py_UNICODE_COPY(outp, qt, 6);135 outp += 6;136 }137 else138 *outp++ = in->str[i];139 break;
426 unmodified lines