forked from jtv/libpqxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up
find_ascii_char()
. (jtv#627)
In `find_ascii_char()`, remove the check for whether it's looking at a single-byte character or a multibyte one. That check is not needed for finding an ASCII character. There are two kinds of encoding: "ASCII-safe" encodings, where no byte in a multibyte character will ever resemble an ASCII character. For those, `find_ascii_char` searches all bytes one by one, ignoring where the actual character boundaries are. "Non-ASCII-safe" encodings, where the ASCII byte value we're looking for may occur in the middle of a multibyte character... but never at the beginning of one. For those, `find_ascii_char` only looks at the first byte of each character. Shaves a few percent off query streaming time.
- Loading branch information
Showing
1 changed file
with
31 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters