Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
03c3e35d
Kaydet (Commit)
03c3e35d
authored
Nis 09, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add fast-path in PyUnicode_DecodeCharmap() for pure 8 bit encodings:
cp037, cp500 and iso8859_1 codecs
üst
0f344b6e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
cp037.py
Lib/encodings/cp037.py
+0
-1
cp500.py
Lib/encodings/cp500.py
+0
-1
iso8859_1.py
Lib/encodings/iso8859_1.py
+0
-1
unicodeobject.c
Objects/unicodeobject.c
+26
-1
No files found.
Lib/encodings/cp037.py
Dosyayı görüntüle @
03c3e35d
...
...
@@ -301,7 +301,6 @@ decoding_table = (
'
\xd9
'
# 0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
'
\xda
'
# 0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
'
\x9f
'
# 0xFF -> CONTROL
'
\ufffe
'
## Widen to UCS2 for optimization
)
### Encoding table
...
...
Lib/encodings/cp500.py
Dosyayı görüntüle @
03c3e35d
...
...
@@ -301,7 +301,6 @@ decoding_table = (
'
\xd9
'
# 0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
'
\xda
'
# 0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
'
\x9f
'
# 0xFF -> CONTROL
'
\ufffe
'
## Widen to UCS2 for optimization
)
### Encoding table
...
...
Lib/encodings/iso8859_1.py
Dosyayı görüntüle @
03c3e35d
...
...
@@ -301,7 +301,6 @@ decoding_table = (
'
\xfd
'
# 0xFD -> LATIN SMALL LETTER Y WITH ACUTE
'
\xfe
'
# 0xFE -> LATIN SMALL LETTER THORN (Icelandic)
'
\xff
'
# 0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
'
\ufffe
'
## Widen to UCS2 for optimization
)
### Encoding table
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
03c3e35d
...
...
@@ -7281,6 +7281,7 @@ PyUnicode_DecodeCharmap(const char *s,
enum PyUnicode_Kind mapkind;
void *mapdata;
Py_UCS4 x;
unsigned char ch;
if (PyUnicode_READY(mapping) == -1)
return NULL;
...
...
@@ -7288,8 +7289,32 @@ PyUnicode_DecodeCharmap(const char *s,
maplen = PyUnicode_GET_LENGTH(mapping);
mapdata = PyUnicode_DATA(mapping);
mapkind = PyUnicode_KIND(mapping);
if (mapkind == PyUnicode_1BYTE_KIND && maplen >= 256) {
/* fast-path for cp037, cp500 and iso8859_1 encodings. iso8859_1
* is disabled in encoding aliases, latin1 is preferred because
* its implementation is faster. */
Py_UCS1 *mapdata_ucs1 = (Py_UCS1 *)mapdata;
Py_UCS1 *outdata = (Py_UCS1 *)writer.data;
Py_UCS4 maxchar = writer.maxchar;
assert (writer.kind == PyUnicode_1BYTE_KIND);
while (s < e) {
ch = *s;
x = mapdata_ucs1[ch];
if (x > maxchar) {
if (_PyUnicodeWriter_PrepareInternal(&writer, 1, 0xff) == -1)
goto onError;
maxchar = writer.maxchar;
outdata = (Py_UCS1 *)writer.data;
}
outdata[writer.pos] = x;
writer.pos++;
++s;
}
}
while (s < e) {
unsigned char ch;
if (mapkind == PyUnicode_2BYTE_KIND && maplen >= 256) {
enum PyUnicode_Kind outkind = writer.kind;
void *outdata = writer.data;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment