aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/utils/int_array_view.h
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-08-12 12:53:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-12 12:53:07 +0000
commita5e6c10824f45a5309d1705e11de27d1e0059ef5 (patch)
tree09e41fc76d0d459a8f7b0e513b550ef7288bac7b /native/jni/src/utils/int_array_view.h
parent187e4812ac6aa3c9b8b692d5887265679f877c65 (diff)
parent47ae73685aab3e758978e1fdc53c3b6e2d5e3a43 (diff)
downloadlatinime-a5e6c10824f45a5309d1705e11de27d1e0059ef5.tar.gz
latinime-a5e6c10824f45a5309d1705e11de27d1e0059ef5.tar.xz
latinime-a5e6c10824f45a5309d1705e11de27d1e0059ef5.zip
am 47ae7368: Merge "Add bigrams to language model content."
* commit '47ae73685aab3e758978e1fdc53c3b6e2d5e3a43': Add bigrams to language model content.
Diffstat (limited to 'native/jni/src/utils/int_array_view.h')
-rw-r--r--native/jni/src/utils/int_array_view.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/native/jni/src/utils/int_array_view.h b/native/jni/src/utils/int_array_view.h
index c1ddc9812..53f2d2971 100644
--- a/native/jni/src/utils/int_array_view.h
+++ b/native/jni/src/utils/int_array_view.h
@@ -91,6 +91,11 @@ class IntArrayView {
return mPtr + mSize;
}
+ // Returns the view whose size is smaller than or equal to the given count.
+ const IntArrayView limit(const size_t maxSize) const {
+ return IntArrayView(mPtr, std::min(maxSize, mSize));
+ }
+
private:
DISALLOW_ASSIGNMENT_OPERATOR(IntArrayView);