summaryrefslogtreecommitdiff
path: root/platform/android/src/geojson/feature_collection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/geojson/feature_collection.cpp')
-rw-r--r--platform/android/src/geojson/feature_collection.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/platform/android/src/geojson/feature_collection.cpp b/platform/android/src/geojson/feature_collection.cpp
index c2825e037b..f90d5226b7 100644
--- a/platform/android/src/geojson/feature_collection.cpp
+++ b/platform/android/src/geojson/feature_collection.cpp
@@ -6,24 +6,24 @@ namespace mbgl {
namespace android {
namespace geojson {
-mbgl::FeatureCollection FeatureCollection::convert(jni::JNIEnv& env, jni::Object<FeatureCollection> jCollection) {
+mbgl::FeatureCollection FeatureCollection::convert(jni::JNIEnv& env, const jni::Object<FeatureCollection>& jCollection) {
auto collection = mbgl::FeatureCollection();
if (jCollection) {
- auto jFeatureList = jni::SeizeLocal(env, FeatureCollection::features(env, jCollection));
- auto jFeatures = jni::SeizeLocal(env, java::util::List::toArray<Feature>(env, *jFeatureList));
- auto size = size_t(jFeatures->Length(env));
+ auto jFeatureList = FeatureCollection::features(env, jCollection);
+ auto jFeatures = java::util::List::toArray<Feature>(env, jFeatureList);
+ auto size = size_t(jFeatures.Length(env));
collection.reserve(size);
for (size_t i = 0; i < size; i++) {
- collection.push_back(Feature::convert(env, *jni::SeizeLocal(env, jFeatures->Get(env, i))));
+ collection.push_back(Feature::convert(env, jFeatures.Get(env, i)));
}
}
return collection;
}
-jni::Object<java::util::List> FeatureCollection::features(jni::JNIEnv& env, jni::Object<FeatureCollection> jCollection) {
- static auto javaClass = jni::Class<FeatureCollection>::Singleton(env);
+jni::Local<jni::Object<java::util::List>> FeatureCollection::features(jni::JNIEnv& env, const jni::Object<FeatureCollection>& jCollection) {
+ static auto& javaClass = jni::Class<FeatureCollection>::Singleton(env);
static auto method = javaClass.GetMethod<jni::Object<java::util::List> ()>(env, "features");
return jCollection.Call(env, method);
}