Browse files

More efficient dynamic->NSString conversion.

Reviewed By: yfeldblum

Differential Revision: D5492783

fbshipit-source-id: 40cb24a67e7cc15b01266481e3002ea3a00b17bd
  • Loading branch information...
Andrew Krieger authored and facebook-github-bot committed Jul 27, 2017
1 parent 113e046 commit 886ef0c1ba2d6d06e76109f81617604383344330
Showing with 1 addition and 1 deletion.
  1. +1 −1 React/CxxUtils/
@@ -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 length:dyn.size()]
return [[NSString alloc] initWithBytes:dyn.c_str() length:dyn.size()
case folly::dynamic::ARRAY: {
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:dyn.size()];

0 comments on commit 886ef0c

Please sign in to comment.