diff options
author | 2013-10-01 12:10:56 +0000 | |
---|---|---|
committer | 2013-10-01 12:10:57 +0000 | |
commit | 74577bedb3bb0dabd0e661270f9da0c11c4b0f46 (patch) | |
tree | 58c9191f8bcfb5cd0f69e1ba7dd11e4005e43a37 /native/jni/src/utils/char_utils.h | |
parent | ff9476f10ae271aa6df87aadb8b2b9edfeeb8a1d (diff) | |
parent | 459cd6f8ef3eaa561e47dd996ce537770ea8b37a (diff) | |
download | latinime-74577bedb3bb0dabd0e661270f9da0c11c4b0f46.tar.gz latinime-74577bedb3bb0dabd0e661270f9da0c11c4b0f46.tar.xz latinime-74577bedb3bb0dabd0e661270f9da0c11c4b0f46.zip |
Merge "Implement the heuristic for auto-commit."
Diffstat (limited to 'native/jni/src/utils/char_utils.h')
-rw-r--r-- | native/jni/src/utils/char_utils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/native/jni/src/utils/char_utils.h b/native/jni/src/utils/char_utils.h index 2e735a81c..41663c81a 100644 --- a/native/jni/src/utils/char_utils.h +++ b/native/jni/src/utils/char_utils.h @@ -75,6 +75,16 @@ class CharUtils { return c; } + static AK_FORCE_INLINE int getSpaceCount(const int *const codePointBuffer, const int length) { + int spaceCount = 0; + for (int i = 0; i < length; ++i) { + if (codePointBuffer[i] == KEYCODE_SPACE) { + ++spaceCount; + } + } + return spaceCount; + } + static unsigned short latin_tolower(const unsigned short c); private: |