From 886ef0c1ba2d6d06e76109f81617604383344330 Mon Sep 17 00:00:00 2001 From: Andrew Krieger Date: Wed, 26 Jul 2017 18:23:20 -0700 Subject: [PATCH] More efficient dynamic->NSString conversion. Reviewed By: yfeldblum Differential Revision: D5492783 fbshipit-source-id: 40cb24a67e7cc15b01266481e3002ea3a00b17bd --- React/CxxUtils/RCTFollyConvert.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/CxxUtils/RCTFollyConvert.mm b/React/CxxUtils/RCTFollyConvert.mm index dcc18a401..0a728047e 100644 --- a/React/CxxUtils/RCTFollyConvert.mm +++ b/React/CxxUtils/RCTFollyConvert.mm @@ -29,7 +29,7 @@ id convertFollyDynamicToId(const folly::dynamic &dyn) { case folly::dynamic::DOUBLE: return @(dyn.getDouble()); case folly::dynamic::STRING: - return [[NSString alloc] initWithData:[NSData dataWithBytes:dyn.data() length:dyn.size()] + return [[NSString alloc] initWithBytes:dyn.c_str() length:dyn.size() encoding:NSUTF8StringEncoding]; case folly::dynamic::ARRAY: { NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:dyn.size()];