Speedup decodeUnicodeEscape by avoiding useless string replace. by rchateauneu · Pull Request #1324 · RDFLib/rdflib (original) (raw)
This avoids costly strings replaces if there is no backslash in the string.
Tested by parsing orkg.nt :
Before:
Explanation: When there are no backslashes in the string (which is the most common case), the function decodeUnicodeEscape() returns immediately.