More efficient dynamic->NSString conversion.
Reviewed By: yfeldblum Differential Revision: D5492783 fbshipit-source-id: 40cb24a67e7cc15b01266481e3002ea3a00b17bd
This commit is contained in:
parent
113e046444
commit
886ef0c1ba
|
@ -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()];
|
||||
|
|
Loading…
Reference in New Issue