https://github.com/python/cpython/commit/d915492413869d616e269e7568c1ff08f02911cc
commit: d915492413869d616e269e7568c1ff08f02911cc
branch: main
author: Brittany Reynoso <[email protected]>
committer: corona10 <[email protected]>
date: 2026-08-29T03:37:45Z
summary:

gh-156537: Optimize codec.decode by inlining the per-character write in CJK 
decoders (gh-156538)

files:
M Modules/cjkcodecs/cjkcodecs.h

diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index 9d86396f73b2b55..41e1287c8650701 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -155,8 +155,8 @@ get_module_state(PyObject *mod)
 
 #define OUTCHAR(c)                                                         \
     do {                                                                   \
-        if (_PyUnicodeWriter_WriteChar(writer, (c)) < 0)                   \
-            return MBERR_EXCEPTION;                                         \
+        if (_PyUnicodeWriter_WriteCharInline(writer, (c)) < 0)             \
+            return MBERR_EXCEPTION;                                        \
     } while (0)
 
 #define OUTCHAR2(c1, c2)                                                   \

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to