Mercurial > public > mercurial-scm > hg-stable
diff mercurial/compat.h @ 33944:f4433f2713d0
encoding: add function to test if a str consists of ASCII characters
Most strings are ASCII. Let's optimize for it.
Using uint64_t is slightly faster than uint32_t on 64bit system, but there
isn't huge difference.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 23 Apr 2017 12:59:42 +0900 |
parents | 7b22599dcb85 |
children | 11ed2eadf937 |
line wrap: on
line diff
--- a/mercurial/compat.h Sun Apr 23 14:47:52 2017 +0900 +++ b/mercurial/compat.h Sun Apr 23 12:59:42 2017 +0900 @@ -7,8 +7,10 @@ #define inline __inline #if defined(_WIN64) typedef __int64 ssize_t; +typedef unsigned __int64 uintptr_t; #else typedef int ssize_t; +typedef unsigned int uintptr_t; #endif typedef signed char int8_t; typedef short int16_t;