From c2fbd7c64d97743723d4d4da3f8dacf797ad0339 Mon Sep 17 00:00:00 2001
From: Ben Cheng <bccheng@google.com>
Date: Wed, 3 Apr 2013 16:59:29 -0700
Subject: [PATCH] Force inlining Correction::isSingleQuote

Also, only apply -Winline with GCC 4.6. There are some copy constructors
that GCC 4.7/4.8 fail to inline.

Change-Id: I97906045224e89377e8ea6add07a79fa088648af
---
 native/jni/Android.mk       | 2 +-
 native/jni/src/correction.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/native/jni/Android.mk b/native/jni/Android.mk
index 3735ec07ba..7f80dc5d74 100644
--- a/native/jni/Android.mk
+++ b/native/jni/Android.mk
@@ -32,7 +32,7 @@ LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-ali
     -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers
 
 ifeq ($(TARGET_ARCH), arm)
-ifneq ($(TARGET_GCC_VERSION), 4.7)
+ifeq ($(TARGET_GCC_VERSION), 4.6)
 LOCAL_CFLAGS += -Winline
 endif # TARGET_GCC_VERSION
 endif # TARGET_ARCH
diff --git a/native/jni/src/correction.h b/native/jni/src/correction.h
index f0d62102fd..a9e9b48a64 100644
--- a/native/jni/src/correction.h
+++ b/native/jni/src/correction.h
@@ -307,7 +307,7 @@ inline void Correction::startToTraverseAllNodes() {
     mNeedsToTraverseAllNodes = true;
 }
 
-inline bool Correction::isSingleQuote(const int c) {
+AK_FORCE_INLINE bool Correction::isSingleQuote(const int c) {
     const int userTypedChar = mProximityInfoState.getPrimaryCodePointAt(mInputIndex);
     return (c == KEYCODE_SINGLE_QUOTE && userTypedChar != KEYCODE_SINGLE_QUOTE);
 }
-- 
GitLab